add askIfShouldIgnoreMousedown()#343
Merged
mikehaverstock merged 3 commits intomainfrom Feb 27, 2026
Merged
Conversation
anandthakker
approved these changes
Feb 27, 2026
| constructor(public version: 1 | 2 | 3) {} | ||
|
|
||
| ignoreNextMousedown: (_el: MouseEvent) => boolean; | ||
| askIfShouldIgnoreMousemove: ( |
There was a problem hiding this comment.
Naming: should this just be ignoreMousemove? That would be consistent with the existing ignoreNextMousedown
Member
Author
There was a problem hiding this comment.
Maybe. That one is weird becuase we dont use the callback. We use the method that you can call. So the callback version doesnt really need to exist. And this definitely isn't something you should call to ignore a mousedown. It really is only there to answer the question when mathquill needs it answered
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The idea is that sometimes mathquill is embedded in bigger documents. You can start a selection within the mathquill but eventually your mouse can move outside of the mathquill and onto other text that should get selected. When selection is handled by something higher up you want mathquill to stop responding to mousemoves. Otherwise you get fighting between the parent that's trying to select the entire mq. You can't just cancel the mousemove listeners because your mouse might move back into the mathquill. At that point you want the mq to resume taking control of the selection.
This also fixes a bug where if a mathquill loses focus and gains it again during a mouse selection it'll restore the selection to where it originally started instead of being cleared to the end.