iter(g261): 删除标签后焦点归还输入框
This commit is contained in:
@@ -40,7 +40,10 @@ export function inputTag(props: InputTagProps): HTMLElement {
|
||||
type: 'button',
|
||||
class: 'ua-tag-close',
|
||||
'aria-label': `移除标签 ${tag}`,
|
||||
onClick: () => put(props.value().filter((item) => item !== tag)), // 按值删,不用索引(外部可能已改序)
|
||||
onClick: () => {
|
||||
put(props.value().filter((item) => item !== tag)); // 按值删,不用索引(外部可能已改序)
|
||||
input.focus(); // 焦点归还:chip 一删按钮就消失,不接住焦点会掉回 body
|
||||
},
|
||||
}, '×');
|
||||
root.insertBefore(h('span', { class: 'ua-tag' }, h('span', {}, tag), close), input);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user