-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Clicking on a link url within the link tooltip does not always take you to the url #747
Comments
Do you mean when you click on the link in the tooltip? When you click on a link in the editor the correct behavior is to always show the tooltip and never to navigate away. |
Yes, the issue is specifically clicking the link in the tooltip (not the editor) |
When clicking the link in the toolbar does not cause navigation, does the tooltip also stay open? |
No, the tooltip closes when you click on the link within it, but a new tab fails to open with that url. |
Added a video to show the intermittent repro case in Chrome 51 on Mac 10.11: Could it be some kind of race condition between when the tooltip closes (removing link from the DOM) and when the link click handler action takes place? |
Actually it looks like the cause might be clicking above the link, but still within the tooltip. |
You know I thought that might be the case but you'll notice when it doesn't work, you still get the pointer cursor and more importantly, if you look at the browser status bar at the bottom, it does show the link url, which it typically only shows when your mouse is specifically over a clickable link target. |
I can reproduce. Tested with Firefox 47 and Chrome 51 on Windows 7. |
So I think the root issue is a long click vs a short click. Mousedown currently blurs the editor which makes selection-change fire with a null range. So if a click action is not fast enough the browser seems to fire a mousedown first without the click event which would normally trigger navigation. The solution could be to just not hide the tooltip when the editor selection becomes null. This would mean the tooltip would not hide when the user clicks outside of the editor. Does this sound like a reasonable compromise? |
Alternatively could you trigger the click on mousedown event to see if that solves it? So attach a mousedown event handler on the link and trigger the click via something like this? let mouseEvent = new MouseEvent('click') |
That would solve the issue of a long click on the link but not clicking just outside of the link area. This would still cause the editor to blur and selection-change to null. |
Personally I'm fine with solving long-click issue on the link (might need to apply same approach to Edit / Save / Remove actions as well) but still having the tooltip close when you don't click on one of the actions within the tooltip. I'd personally rather have that then not have the tooltip automatically hide when the user clicks outside of the editor since that would be somewhat of a hassle when you just want to move on to something else unrelated to the editor. |
I'm intermittently experiencing issues where when clicking on a link, seeing the resulting tooltip, and then clicking on the link url within the tooltip does not always take me to the webpage. It's an intermittent issue where sometimes it works but sometimes nothing happens. No error is shown in the console.
Steps for Reproduction
Expected behavior:
Each time the link is opened
Actual behavior:
Only sometimes does it actually take me to the link
Platforms:
Chrome 51 on Mac 10.11
Version:
Quill 1.0 Beta 4
The text was updated successfully, but these errors were encountered: