Duo Chat > Prevent prompt submission while composing (Japanese IME)
As reported in gitlab#430124 (comment 1653342235), there's an issue when using IMEs with Duo Chat.
While typing in a textarea with an IME enabled, the Enter key would be used to select one of the completion suggestions from the list:
However, the GlDuoChat
component overrides the Enter event to submit the prompt, effectively breaking the UX for IME users. A workaround is to pick from the IME using the mouse instead of the keyboard, but that's less than ideal and possibly breaking in terms of accessibility.
If the event really needs to be intercepted, we should ensure that it does not submit the prompt while the user is interacting with an IME, which should be doable thanks to the compositionstart
and compositionend
events.
A similar issue was reported in gitlab#434300 (closed) with technical solutions proposed in gitlab#434300 (comment 1771846739). We'll audit GitLab's codebase for other occurrences of this issue as part gitlab#443502 (closed).
/cc @dmishunov @leipert