question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add more ways to move out of mathfield

See original GitHub issue

Prerequisites

  • New issue

Description

It is possible to leave the math field using

  • Right and left arrow keys
  • Tab

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:closed
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
arnogcommented, Aug 22, 2020

The codepen is here: https://codepen.io/arnog/pen/OJNWLNJ

To check if the mathfield is in command mode, check mathfield.mode === 'command'

1reaction
arnogcommented, Jun 13, 2022

@wlewis-formative yes, that’s correct

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customizing a Mathfield - CortexJS
To have proper legibility based on usage, these color names will map to different values when used as a foreground color and a...
Read more >
How to Move Out of Your Parents' House in 13 Easy Steps
To help you successfully move out of your parents' home, we've put together 13 easy steps that are sure to help you achieve...
Read more >
What's the Cheapest Way to Move Out of State? - Ramsey
So you're looking for ways to save money as you embark on a journey to a new state. You came to the right...
Read more >
Rugby union - Wikipedia
The field has H-shaped goalposts at both ends. Rugby union. New Zealand vs South Africa 2006 Tri Nations Line Out.JPG. South African Victor...
Read more >
15 Tips For Moving Out of State | Move.org
This will help dictate where you live, how much you spend on housing, etc. 2. Ask your boss about relocation assistance. Another perk...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found