修复编辑列表名字时按esc键无法退出编辑状态的问题
parent
bdb9f9b949
commit
e79f8b357c
|
@ -28,11 +28,9 @@ export default ({ dom_lists_list }: {
|
||||||
let name = dom_input.value.trim()
|
let name = dom_input.value.trim()
|
||||||
if (dom_target.dataset.index == null) return
|
if (dom_target.dataset.index == null) return
|
||||||
const targetList = userLists[parseInt(dom_target.dataset.index)]
|
const targetList = userLists[parseInt(dom_target.dataset.index)]
|
||||||
if (name.length) {
|
if (name.length) await updateUserList([{ ...targetList, name }])
|
||||||
await updateUserList([{ ...targetList, name }])
|
|
||||||
dom_target.classList.remove(styles.editing)
|
|
||||||
}
|
|
||||||
dom_input.value = targetList.name
|
dom_input.value = targetList.name
|
||||||
|
dom_target.classList.remove(styles.editing)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCreateList = async(event: Event) => {
|
const handleCreateList = async(event: Event) => {
|
||||||
|
|
Loading…
Reference in New Issue