Closed mikehaverstock closed 2 years ago
I don't know why this test is failing. It's passing for me locally.
retest windows
Just want to verify my understanding: we always have startIndex <= endIndex
, right? So this API isn't giving information about the orientation of the selection?
I think that's probably a good call for the public API. Can't see a ton of reasons to care about selection orientation, and it'd likely trip people up who haven't thought about that before if we did represent it.
Did you ever figure out where info is stored about whether the cursor is displayed in a MathQuill (or in other words, whether it has focus)? Could see that being useful to report here too, but maybe you can just get that some other way. Wouldn't be a breaking change to add it later.
startIndex <= endIndex
Yes. We don't keep orientation. startIndex can't be after endIndex.
Did you ever figure out where info is stored about whether the cursor is displayed in a MathQuill (or in other words, whether it has focus)? Could see that being useful to report here too, but maybe you can just get that some other way. Wouldn't be a breaking change to add it later.
No. In my use case I won't need it. The mq will always be focused when I ask this question. If there is a way to ask it explicitly then callers of this method can just call it. There are definitely cases where you can have a selection in an unfocsed mathquill. So it probably makes sense to not conflate focus with store dcursor/selection position.
Adds a
.selection()
method to get the current selection out of the mathquill instance. Will return something like: