yairEO/tagify

Mix Mode - Safari caret position after new tag

matrixengine opened this issue · 17 comments

Hi,

In Safari for Mac, when adding a new tag, the cursor jumps to the start of the tag opposed to the end. This means when you start typing it actually types before the tag not after.

I don't mind doing a bit of self diag, but could you point me in the right direction? Might need some sort of timeout before re-positioning the cursor after the tag add function has completed.

--

It would also be great if you can add the option in mix mode of forcing a space after a tag when added. I know currently it adds a zero width space, but it would be of benefit to have a visual space to maintain formatting when tags are used within a sentence.

Thanks.

Does this also happens in Chrome (Mac)?

A good place to start debugging is this method

No, just safari :(

Please try now with latest version: 2.31.0 and let me know

This is unfortunately still an issue in Safari (on Mac). Works fine in Chrome.

Just released version 3.0.0 so this should work. Try updating Tagify and check.

Also, added a new position setting for the dropdown, which should be very useful in mixed-mode.

set dropdown.position to text and the dropdown should appear next to the caret, while typing.

Thanks @yairEO . Just tested it out. Unfortunately still an issue. Here is a video of the problem (in latest version of Safari): https://recordit.co/im73msH7Qo

And a gif version: http://g.recordit.co/im73msH7Qo.gif

@yairEO if I open this JsBin in Safari and add some tags (using the @ symbol), every time the cursor is to the left of the tag:
https://jsbin.com/wokovon/edit?html,js,output

You are using older version in your demo (pre v3), please clone this one

Also, I don't have a Mac to test Safari at the moment, it might take a few months to come by a Mac. I really hope that using v3 will work on your Safari

tck commented

Tested with Version 3.2.0. The caret problem also exists in Firefox (v71). Chrome works perfect.

Tried your demo on FF v71 and it seems to work when selecting tags with the keyboard. The caret stays at the end.

GIF

But there is a completely different bug: when selecting a tag with the mouse, and that tag was the last one (no text after it) then nothing can be written in the input afterwards, regardless of focus.

I have made a little change in the new 3.2.2 version, so you can try it now and report

tck commented

Thx for your changes. Still have the problem some times. See this fiddle:
https://jsfiddle.net/zdq5nck9/
After focus the field some times i got the caret after the last tag. Some times there is no caret.

Hi @yairEO. I've just noticed that BrowserStack have a free plan for Open Source projects: https://www.browserstack.com/pricing (see bottom of page).

Would that be helpful for testing issues like this? Happy to help you apply for this if I can help in any way.

Maybe now using tagify@3.3.0 ?

sut10 commented

This issue still exists with tagify v3.10.2 using Safari v13.1. The caret remains before the tag that was inserted using the whitelist dropdown.

Ok, finnaly got to it and fixed it.
will release a new version tomorrow along with the fix!

Sorry for the long delay

Hi Yair
still not working on Safari
did you find some bug about that issue ?
Thank you