Skip to content

Commit 6ad81a3

Browse files
add documentation
1 parent 31be7c9 commit 6ad81a3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/Api_Methods.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,18 @@ If a timeout (in ms) is supplied, and the math field has keyboard focus when the
289289

290290
Returns the suffix to be appended to the [ARIA label][`aria-label`], after the math content of the field. If no ARIA post-label has been specified, `''` (empty string) is returned.
291291

292+
## .isUserSelecting()
293+
294+
Returns `true` if the user is currently selecting text with the mouse, `false` otherwise. This can be useful for preventing certain actions (like setting the cursor position) while the user is actively dragging to select text. The method tracks mouse selection from the moment the user presses the mouse button down to start selecting until they release it or the selection is cancelled due to an edit operation.
295+
296+
```javascript
297+
if (!mathField.isUserSelecting()) {
298+
// Safe to programmatically change cursor position
299+
mathField.moveToLeftEnd();
300+
}
301+
```
302+
303+
292304
[`aria-label`]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute
293305

294306
## .config(new_config)

0 commit comments

Comments
 (0)