Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve the problem that / cannot evoke toolbox in Chinese input method… #2750

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

chf-gh
Copy link

@chf-gh chf-gh commented Jun 29, 2024

  1. Solve the problem that / cannot evoke toolbox in Chinese input method. the symbol / : event.key=Process, event.code=Slash, event.keyCode=229
  2. Solve the problem that / is automatically entered in searchInput after Chinese input method evokes toolbox

…, and solve the problem that / is automatically entered in searchInput after Chinese input method evokes toolbox
Comment on lines +255 to +257
setTimeout(() => {
this.activateToolbox();
}, 0);
Copy link
Member

@neSpecc neSpecc Jun 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. this change looks unclear for me. Previous solution looks more explicit. Why it is not working?

  2. We're trying to get rid of setTimeout in a code since it leads of problems of caret behavior which are hard to maintain.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original code's event.preventDefault() cannot prevent the / input in Chinese mode, causing / to be automatically entered in the SearchInput.

So how it prevented now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants