Open woylie opened 1 week ago
More resources regarding IMEs and JavaScript:
@woylie can you please try {:phoenix_live_view, github: "phoenixframework/phoenix_live_view", branch: "sd-input-composition", override: true}
?
I'm not familiar with composition mode, but the idea is to skip sending an event to the server while compositing and only trigger the regular phx-change after it is finished.
It appears that form updates break the character composition mode for Japanese input sources (and potentially other input sources with character composition) in Safari under certain conditions.
Environment
Setup
The demo application (https://github.com/woylie/jp_input) was generated with
mix phx.server
andmix phx.gen.live
. Other than replacingtype="text"
withtype="textarea"
, no changes were made.git clone https://github.com/woylie/jp_input
cd jp_input
mix setup
mix phx.server
Japanese - Romaji
as an input source as described here: https://support.apple.com/guide/japanese-input-method/set-up-the-input-source-jpim10267/macReproduction
Edit
on the existing thing.return
to create a new line in the middle.d
and thene
.What should happen
d
, the letterd
should appear in the textarea with a thick underline.e
, the letterd
in the textarea should be replaced with aで
.return
to confirm the character, the underline disappears.The thick underline indicates character composition mode, in which you can choose different candidates with the
space
key.What really happens
d
, the letterd
appears in the textarea without the underline.e
, the characterえ
(e) appears in the textarea. The textarea now contains the textdえ
instead ofで
.Observations
Edit
link, character composition works.phx-change
from the form, the issue disappears.Resources