Open jijiseong opened 1 month ago
It looks like there are two different issues here.
onChange not being called
When typing using an IME, the browser doesn't send certain events until after composition has finished. You can detect when IME composition is taking place by adding compositionstart
, compositionupdate
and compositionend
handlers to your editor. https://stackoverflow.com/a/37099672
Placeholder remaining visible Curiously, Slate's custom placeholder example doesn't have this problem.
https://github.com/udecode/plate/assets/4272090/4ca9542a-5c02-48ba-9eed-55a0465d7f70
As a temporary workaround, you could try using the placeholder
prop on PlateContent rather than using Plate's custom placeholder component. If you're interested in working on a proper fix for this, you could try investigating Slate's code to see how it knows to hide the placeholder. I'm guessing it's using a boolean state variable that it sets on compositionstart
and compositionend
.
I found the logic that Slate uses to hide the placeholder during composition:
Thanks for your quick response!
Description
I type Korean consonant in editor such as 'ㄱ', 'ㄴ', 'ㄷ' ... onChange does not work.
Steps to Reproduce
https://github.com/udecode/plate/assets/77661228/26918d2b-93d2-4f4c-95e9-73d57fedf02b
Sandbox
Expected Behavior
The placeholder still exists when typing
'ㅈ'
.I type
'ㅈ', 'ㅣ', 'ㅅ', 'ㅓ', 'ㅇ'
exptected console
But actually
I tried to fix this error. But I don't know what is causing it.
Environment
Bounty
Click here to add a bounty via Algora.
Funding