tagger icon indicating copy to clipboard operation
tagger copied to clipboard

Safari Loses Focus After 2 Key Presses

Open rdetert opened this issue 4 years ago • 4 comments

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.

rdetert avatar Jun 22 '20 07:06 rdetert

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.

jcubic avatar Jun 22 '20 09:06 jcubic

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.

rdetert avatar Jun 23 '20 08:06 rdetert

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

lucasnetau avatar Jun 28 '22 11:06 lucasnetau

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

jcubic avatar Jun 28 '22 11:06 jcubic

Released in version 0.4.3. Thanks @lucasnetau.

jcubic avatar Aug 23 '22 09:08 jcubic