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

Safari Loses Focus After 2 Key Presses #7

Closed
rdetert opened this issue Jun 22, 2020 · 5 comments · Fixed by #24
Closed

Safari Loses Focus After 2 Key Presses #7

rdetert opened this issue Jun 22, 2020 · 5 comments · Fixed by #24
Labels
bug Something isn't working

Comments

@rdetert
Copy link

rdetert commented Jun 22, 2020

Firefox doesn't have this problem but Safari does. For some reason, I can only type two characters in the tag box before I lose focus and have to click inside the input box again.

@jcubic
Copy link
Owner

jcubic commented Jun 22, 2020

This is may be some inconsistency in Safari browser, I've found question on SO datalist input element loses cursor after datalist list attribute is set on ios safari I've added a bounty I will wait and see if someone reply.

Maybe the solution is not to add the "list" attribute, but only element with the menu. This is something I can test on BrowserStack.

@rdetert
Copy link
Author

rdetert commented Jun 23, 2020

Oddly enough, in version 13.0.3 only the first two keys will display, but if you press the comma at any time after, it will still create a new tag.

@jcubic jcubic added the bug Something isn't working label Jun 23, 2020
@lucasnetau
Copy link
Contributor

lucasnetau commented Jun 28, 2022

I found a simple workaround was to set an invalid list value on _toggle_completion(false) instead of removing the list attribute. Additionally _toggle_completion(false) was called after initialisation of _new_input_tag in init().

Changing the list attribute does not appear to trip over Safari losing focus and Chrome/Firefox work as expected.

I can provide a PR

@jcubic
Copy link
Owner

jcubic commented Jun 28, 2022

Sure, go ahead and create a PR. I will test it on BrowserStack if it works.

@jcubic
Copy link
Owner

jcubic commented Aug 23, 2022

Released in version 0.4.3. Thanks @lucasnetau.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants