Add more ways to move out of mathfield
See original GitHub issuePrerequisites
- New issue
Description
It is possible to leave the math field using
Right
andleft
arrow keysTab
However, a few other editors that I’m used to also make it possible to “submit” an expression. This means, when the user hits Enter
and isn’t in command mode, the mathfield loses focus.
Furthermore, it would be great if the up
and down
arrow keys could also be used to leave a math field. This is quite useful when you have multiple math fields in a row. An example of the behavior I’m looking for.
Actual behavior
The mathfield keeps focus
Expected Behavior
It should be possible to leave the mathfield using those keys as well
- Enter
- Up or down
Notes
I sadly don’t think that this can simply be implemented in userland by using the shortcuts feature nor with onKeystroke
.
Lastly, I’m more than willing to open a PR that implements this. However, I’d need a bit of guidance regarding where to start.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (8 by maintainers)
Top GitHub Comments
The codepen is here: https://codepen.io/arnog/pen/OJNWLNJ
To check if the mathfield is in command mode, check
mathfield.mode === 'command'
@wlewis-formative yes, that’s correct