-
Notifications
You must be signed in to change notification settings - Fork 58
Restore current_text on blur/focus in tags mode. #100
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
Restore current_text on blur/focus in tags mode. #100
Conversation
@maxmarcon ping, just wanted to see if you had some thoughts on this or if there's anything else I can do to help get this fixed? |
Hi sorry for the delay. Good catch. One question: doesn't the same thing happen in single mode? Shouldn't we fix both? Thanks |
@maxmarcon Sorry for the delay on my end this time. :) I tested in single mode and, you're right, I see the same issue there. I added another commit to this PR which appears to solve it for me. |
your changes break single mode. If I select something, the input box doesn't show the selection, but the text that I have entered. This was the purpose of this logic: if (mode === "single") {
const label = selection.length > 0 ? selection[0].label : null
this.setInputValue(label)
} which you removed. Screen.Recording.2025-03-30.at.19.12.58.mov |
Maybe using: const label = selection.length > 0 ? selection[0].label : current_text could be enough to fix it. |
@maxmarcon Thank you, I pushed that change now. |
merged - plus enabled the same logic for |
Hi @bratsche I reverted these changes and made the behavior you're expecting here opt-in. Now
May I kindly ask you to test your code against the latest main, using the |
When in
tags
mode if you type something into the text field, focus your cursor out of the component and then back into it, then it gets into a weird state. The text that you've typed into the input disappears when your blur, but when you focus again the selections remain as they were before the blur (so that the user needs to type something and then backspace it away in order to reset the selections).This PR takes the approach of maintaining the current text in the input field when blurring the cursor away from it.
Here's a clip demonstrating the bug:
select-bug.mov
Here's a clip demonstrating with this PR:
select-fix.mov