Skip to content

character-count.js does not handle form reset event, affecting remaining character count #48

@IK-Ngoo

Description

@IK-Ngoo

Issue snapshot

image

瀏覽器 F12 > Recorder 匯入測試 character-count.js.json 可重現問題。

Root cause

處理前文字輸入區塊 (Textarea) 元件根據 <textarea> 輸入事件更新剩餘字數資訊。

References

js

textarea.addEventListener('input', (event) => {
const remaining = total - textarea.value.length
if (event.isComposing !== true) updateNotice()
})

Possible solutions

將上層 form 元素的 reset 事件納入監聽,更新剩餘字數資訊。

Metadata

Metadata

Assignees

Labels

缺陷 bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions