Solve the problem that / cannot evoke toolbox in Chinese input method…#2750
Solve the problem that / cannot evoke toolbox in Chinese input method…#2750chf-gh wants to merge 2 commits intocodex-team:nextfrom
Conversation
…, and solve the problem that / is automatically entered in searchInput after Chinese input method evokes toolbox
| setTimeout(() => { | ||
| this.activateToolbox(); | ||
| }, 0); |
There was a problem hiding this comment.
-
this change looks unclear for me. Previous solution looks more explicit. Why it is not working?
-
We're trying to get rid of
setTimeoutin a code since it leads of problems of caret behavior which are hard to maintain.
There was a problem hiding this comment.
The reason the toolbox cannot be invoked with the Chinese input method / is that the Chinese / corresponds to event.key = Process instead of /, so event.code === 'Slash' is used to determine if / is pressed. Using setTimeout to invoke the toolbox is mainly to asynchronously invoke the toolbox because the original code's event.preventDefault() cannot prevent the / input in Chinese mode, causing / to be automatically entered in the SearchInput. I don't have any ideas for better asynchronous calls yet.
There was a problem hiding this comment.
the original code's
event.preventDefault()cannot prevent the / input in Chinese mode, causing / to be automatically entered in theSearchInput.
So how it prevented now?
/cannot evoke toolbox in Chinese input method.the symbol / : event.key=Process, event.code=Slash, event.keyCode=229/is automatically entered in searchInput after Chinese input method evokes toolbox