-
Notifications
You must be signed in to change notification settings - Fork 437
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
Delete key, focus/blur and dropdown improvements for select mode with userInput #1410
base: master
Are you sure you want to change the base?
Conversation
When using delete key the behavior was inconsistent and also led to focus lost. Fix this by never calling removeTags() while we are editing but only after blur
Previously the focus class remained even after leaving the input, moreover the dropdown stayed open if navigating with tab. At last the input focus was inconsistent on suggestion selection with a tag present or not, now every time a suggestion is clicked, the input regain focus.
Currently after the user inputs some text and then select a suggestion, the dropdown is stuck to that suggestion list. To see all the suggestions again the dropdown must be toggle. Fixed by showing all suggestions after selection only for select mode (should this be considered for non-select too?)
Do not higlight the next option while in select mode but keep the current one
I need videos showcasing the things these changes are trying to solve.. I do not understand from the description what exactly is the situation for each of your changes and I cannot blindly merge such sensitive changes without completely understanding the problems first and am able to reproduce myself I am a Windows user and this is my favorite video capturing software: |
I'm going to first push some commits because of the changes in 4.32.1 and also 'cause I find better ways to do things... I will update you with videos too. |
This reverts commit 542e73e.
When using delete key the focus was lost when using backspace
d9926e0
to
2b66604
Compare
OK, I have videos for all the parts of this commit and I'm going to step through that one at a time. First some notes: I have updated to 4.32.1 and reapplied the patches one by one to confirm the issues are still present. In the videos attached I'm using my implementation because it was easier for me, but I tried everything on jsbin with a "regular" install and it is the same.
1.mov
3.mp4
5.mov
|
The dropdown was incorrectly closing with right arrow too
f1b5285
to
05a1039
Compare
Hi, I cannot reproduce much of your videos because I don't know your exact Tagify configurations, so I cannot personally confirm the issues. Can you please share it here? |
Sorry I'm not on my PC, it should be about like this. I used a stripped down version with less settings but I don't have it on hand right now. Tell me if this is enough (I tried on jsbin and all the issues were present)
UPDATE with real code |
@@ -96,7 +96,11 @@ export default { | |||
this.state.autoCompleteData = selectedElmData; | |||
this.input.autocomplete.set.call(this, value) | |||
return false | |||
} else if( e.key == 'Tab' && !_s.autoComplete.tabKey && isSelectMode && _s.userInput ) { // do not forget to hide the dropdown in select mode if Tab is pressed |
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.
#1414 depends on this
This reverts commit 5ae3c62.
When input is in edit mode the checkmark stayed on the previous item
Commit 41178f7 I found another issue... Added here (see video). I have tested on jsbin too the only difference here is that because the dropdown closes you can't see the bug (the dropdown closing is itself a bug, given the option to not close it is present). When you click on the input and you are in edit mode (caret blinking), if you select a suggestion with the mouse the checkmark won't be updated (in the video only on second click because I exited edit mode). 1.mov |
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.
This is needed to prevent the dropdown from closing even when closeOnSelect
is false
Sorry I am too slow to respond to your well-done detective work! I work a very demanding full-time job (as a frontend developer) and have so little time for other things. I also have much more (personal) open source and non-open-source projects to maintain... So mostly the only time I have is a little over the weekend |
The same for me 🤣 except that I do my things at night 🌉 I suspected you were only available on the weekends but no worry I'm not here to rush you. I've implemented the changes in production on my module so we can also have a reality check (small as it is...) |
1: When you Tab into the input and then immediately click backspace the focus was lost. This PR fixes the behavior by only removing tags after blur, so that we can still write into the input.
2:
Previously the focus class remained even after leaving the input, fixed by adding a "Tab" handler for select mode too.3: Previously the dropdown stayed open when navigating with tab key (related to point 2), fixed by adding a "Tab" handler for select mode too.
4: The input focus was inconsistent on suggestion selection with a tag present or not, fixed by regaining focus to the input every time a suggestion is clicked.
5: Repopulate suggestions dropdown after selection (currently the dropdown is stuck to a partial state, which is not very desirable in select mode).
6: Do not highlight next option when in select mode (this is not desired, the current one is still present unlike the other modes).