修复编辑列表名字时按esc键无法退出编辑状态的问题

pull/1053/head
lyswhut 2022-11-14 19:02:36 +08:00
parent bdb9f9b949
commit e79f8b357c
1 changed files with 2 additions and 4 deletions

View File

@ -28,11 +28,9 @@ export default ({ dom_lists_list }: {
let name = dom_input.value.trim()
if (dom_target.dataset.index == null) return
const targetList = userLists[parseInt(dom_target.dataset.index)]
if (name.length) {
await updateUserList([{ ...targetList, name }])
dom_target.classList.remove(styles.editing)
}
if (name.length) await updateUserList([{ ...targetList, name }])
dom_input.value = targetList.name
dom_target.classList.remove(styles.editing)
}
const handleCreateList = async(event: Event) => {