-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Simplified search input & fixed chinese character input #3037
Conversation
Oh, OK, can you please test if the following demo is working for you? It is using composition events to trigger the change event once the IME is done. I would use it as it's easier to read. |
I'm not sure it's ok or not to use that component, but looks good. |
@amedora can you please give it another try? I've added the composition input. |
@@ -165,7 +129,7 @@ class TopBar extends React.Component { | |||
} | |||
|
|||
handleCodeInit () { | |||
ee.emit('top:search', this.refs.searchInput.value) | |||
ee.emit('top:search', this.refs.searchInput.value || '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this emit
there? With out adding the || ''
I've got an error from CodeEditor.js
because it seems that the value is undefined here.
How can I test this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I didn't notice that it can be undefined.
search: keyword | ||
}) | ||
ee.emit('top:search', keyword) | ||
const keyword = e.target.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I wanted to use this.refs.searchInput.value
but it wasn't working - maybe there is an issue with CInput
and the ref but with event.target.value
it is woking.
So that's OK and I just wanted to mention it.
LGTM. works like a charm 👍 |
# Conflicts: # browser/main/TopBar/index.js # yarn.lock
@ZeroX-DG Could you test this too? I want to merge this soon. :) |
Works great for me! |
Description
There are mutliple open PRs that are related to search input:
handleSearchChange
. I'm doing the same but with less code if it's OK to remove theisIME
checkingcompositionend
eventl istener with a new stateisIMEdone
that will be set withcompositionend
- I think that's not really needed as directly handling in change handler should work.We should check if all of them are fixed with this PR.
Issue fixed
#2925, #3030, #2843
Type of changes
Checklist:
Screenshot
Note just some chinese letters in there to show that you can now enter these characters
Todos:
isAlphabet, isIME, isConfirmTranslation
(if it's OK to simplify this, see question below)Discussion
switchPreview === 'BLUR' || switchPreview === 'DBL_CLICK'
is working? That change was needed to fix the focus loss but I'm not sure where it is used.IssueHunt Summary
IssueHunt has been backed by the following sponsors. Become a sponsor