-
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
Caret jumps to mouse position or start when selecting option from toolbar select menu #456
Comments
Might be related to this one. |
I'm not understanding step 2, particularly the overlaps editor space part. Can you clarify? |
@jhchen Hopefully the image will help clarify what I mean. Selecting an option on top of the editor space will sometimes cause the editor will focus and the caret will jump under the mouse cursor as if the menu weren't there. I specify "overlapping the editor space" in case the behaviour is different if, say, there is a large margin between the toolbar and the editor. @muhleder Yup, sounds exactly like what I'm experiencing. I suspect that focusing "through" the select menu is another symptom of the problem. I tried to give your fork a spin, but the issues were only exacerbated? I can't apply any styles at all without caret-jumping and editor-unfocusing. I'll have scrutinize a bit more, but would you mind explaining how your change works? |
@acrylic-origami Sure, so from reading other related issues the jumping is caused by the focus called in initFormat() so I removed that but then @quill.getSelection() was not able to get the selected text from the editor. Looking at @quill.getSelection() it's really just a proxy for @Quill. getRange() which has an ignoreFocus option. So I added the ability to set that option in @quill.getSelection(), and called it from initFormat(), and the initFormat() then picked up the range properly. This behaviour in this issue doesn't come from initFormat() I believe, so there may be another call to @quill.focus() in whichever function handles the dropdown here? |
@muhleder I spent a few hours tinkering around and still can't rectify the bugs I'm getting with your fork. If text is highlighted, the format is applied normally. However, with a collapsed selection and without this call to @quill.focus(), the format isn't applied. In the process though, I may have found the underlying cause of both our issues, and strangely it appears to be race condition-related? Removing the |
I believe this is the same root cause as #487 where the mouse action is a slight drag, not merely a click. |
Steps to reproduce:
Using Quill Snow theme. The number of times to repeat is inconsistent and seems to be independent of frequency, but generally it's around 5-10 times. As far as I can tell, it occurs on Chrome 44 and Opera 31 (OS X Yosemite). Cannot reproduce in Firefox 39 or Safari 8.0.6.
The text was updated successfully, but these errors were encountered: