You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default (Chrome) spellchecker waits for 1-2 seconds before triggering, so if you're typing hous you can still type house without the error underline showing. This works fine when native event handler triggers:
<div texteditable="true" spellcheck="true"></div>
Outline handles the events itself (OutlineEventHandlers):
event.preventDefault(); <--
...
case 'insertText':
case 'insertFromComposition': {
if (data) {
insertText(selection, data); <-- type it manually
}
break;
}
The logic for insertText(selection: Selection, text: string) is quite complex but I believe that ultimately we could compare trees and determine whether the native input would equal the computed input, and if that's the case favor the native over ours.
trueadm
changed the title
Spellcheck triggers early because of custom insertText logic
Bug: Spellcheck triggers early because of custom insertText logic
Mar 22, 2021
By default (Chrome) spellchecker waits for 1-2 seconds before triggering, so if you're typing
hous
you can still typehouse
without the error underline showing. This works fine when native event handler triggers:Outline handles the events itself (OutlineEventHandlers):
Repro: https://codepen.io/zurfyx/pen/zYoVdRx?editors=1010
The logic for
insertText(selection: Selection, text: string)
is quite complex but I believe that ultimately we could compare trees and determine whether the native input would equal the computed input, and if that's the case favor the native over ours.(Handling the spellchecker API ourselves doesn't look possible in Chrome and we would also have to handle each browser separately.)
cc @trueadm
The text was updated successfully, but these errors were encountered: