Commit 353d7af
authored
Prevent default for input events that don't have any characters (#33)
Seeing cases where some input events with `inputType=deleteContentBackward` are slipping through. These are probably being created via some mechanism other than a keydown directly on the script (e.g., through some accessibility API, or touch control, or some event that's being targeted elsewhere but propagating to the script accidentally).
We _never_ want draft.js to do anything in response to an `onInput` in our user case. We were relying on our passed-in `handleBeforeInput` to always return `handled`; but we're only hitting that logic when the input event contains characters. This will hopefully fix that.1 parent 2427b66 commit 353d7af
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
0 commit comments