question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HandleBeforeInput doesn't work when typing in Japanese.

See original GitHub issue

HandleBeforeInput doesn’t work when typing in Japanese. For other languages (En, Ru) it works fine.

Used DraftJS v.0.7.0, Firefox 48.0.2\Chrome 52.0.2743.116, Win7\Darwin In the DraftJS v.0.8.1 also doesn’t work.

handleBeforeInput: function (chars) {
    console.log('Checking handleBeforeInput...', chars);
    return true;
},

render() {
        const {editorState} = this.state;
        return (
            <div>
                <Editor
                        editorState={editorState}
                        onChange={this.onChange}
                        handleBeforeInput={this.handleBeforeInput}
                        spellCheck
                        ref="editor"/>
            </div>
        );
    }

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:9
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
f0rdreamcommented, Nov 6, 2018

Last week I discussed this with the other maintainers, and we found some issues that will come up with exposing ‘handleBeforeInput’ during a ‘composition’. When a person is entering Chinese, Korean, or other characters with IME input, Draft is building up a “composition” and the DOM is in an uncertain state. We don’t want to allow any interruption until the composition is finished.

We would like to provide examples of how to do the same thing using a different approach - and for this it would be helpful to get specific examples of the functionality you need in the editor.

Is there any update now (11/6/2018)?

HandleBeforeInput is still not trigged for Chinese with IME input on OSX & Chrome 70

1reaction
doorttscommented, Sep 27, 2016

This problem also happens with Korean. I think CJK inputs have same problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enter keyup event in japanese input - javascript - Stack Overflow
Using the Japanese input method I start typing characters and the event doesn't get triggered; which is expected as the enter characters are ......
Read more >
Japanese IME does not work; unable to switch to Hiragana
I just installed the Japanese language package but I cannot switch from "Direct input" to "Hiragata" or other option.
Read more >
Troubleshoot Japanese on Mac when you can't enter characters
When using a Japanese input source on your Mac, and you can't enter ... press on the second keyboard, the original keyboard may...
Read more >
Unable to change keyboard layout to Japanese language
Japanese keyboard layout does not change in Windows. ... If you load the Onscreen keyboard you should be able to see where the...
Read more >
Eight Typing Tips - CAS - University of Alabama at Birmingham
When Japanese write Japanese, they don't put spaces between words, so you don't either. If you think, "I need a space before the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found