Merge pull request #1984 from gijigae/fix/japanese-ime-input

Fix Japanese IME input handling for tag, step, and reaction fields
This commit is contained in:
Mike Dalessio
2025-12-08 11:09:33 -05:00
committed by GitHub
5 changed files with 26 additions and 6 deletions
@@ -8,10 +8,21 @@ export default class extends Controller {
debounceTimeout: { type: Number, default: 300 }
}
#isComposing = false
initialize() {
this.debouncedSubmit = debounce(this.debouncedSubmit.bind(this), this.debounceTimeoutValue)
}
// IME Composition tracking
compositionStart() {
this.#isComposing = true
}
compositionEnd() {
this.#isComposing = false
}
submit() {
this.element.requestSubmit()
}
@@ -32,6 +43,12 @@ export default class extends Controller {
}
}
preventComposingSubmit(event) {
if (this.#isComposing) {
event.preventDefault()
}
}
debouncedSubmit(event) {
this.submit(event)
}
@@ -245,6 +245,9 @@ export default class extends Controller {
}
},
Enter(event) {
// Skip handling during IME composition (e.g., Japanese input)
if (event.isComposing) { return }
if (event.shiftKey) {
this.#toggleCurrentItem(event)
} else {