File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
components/editor/plugins/patch Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,16 @@ const suppressionTriggers = new Set([
2222 'deleteSoftLineBackward' ,
2323 'deleteSoftLineForward' ,
2424 'deleteWordBackward' ,
25- 'deleteWordForward'
25+ 'deleteWordForward' ,
26+ 'insertText'
2627] )
2728
29+ // Additional checks:
30+ // If a trigger has an associated check, suppression starts only if the check passes.
31+ const suppressionTriggersChecks = {
32+ insertText : ( e ) => e . data === ''
33+ }
34+
2835function applySoftkeyWorkaround ( el ) {
2936 let isCompositionSuppressed = false
3037 let isSelectionSuppressed = false
@@ -57,6 +64,9 @@ function applySoftkeyWorkaround (el) {
5764 const beginCompositionSuppression = ( e ) => {
5865 if ( ! e ) return
5966 if ( ! e . inputType || suppressionTriggers . has ( e . inputType ) ) {
67+ const extraChecks = suppressionTriggersChecks [ e . inputType ]
68+ if ( extraChecks && ! extraChecks ( e ) ) return
69+
6070 isCompositionSuppressed = true
6171
6272 if ( compositionTimeout != null ) {
You can’t perform that action at this time.
0 commit comments