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.

Revert dialog doesn't handle keyboard input as expected (reverts when you may mean cancel)

See original GitHub issue

I’m fairly new to Mac OS so I may have misunderstood this, but I believe that <enter> is supposed to always accept “the blue button” and <space> accepts the “blue-bordered-item” which can be tabbed through.

screen shot 2018-03-06 at 20 09 24

On this dialog, if I tab to the “Discard changes” button and then press either <enter> or <space> it still seems to discard, but I expected one to cancel.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Sep 18, 2018

I’m a little confused - the linked comment suggests you want to follow macOS, but that doesn’t seem to be what’s happening. On macOS, <enter> does not do the button highlighted with <tab>, it does the blue/default button.

(I’m also not sure about the reviewer-needs-to-reproduce label?)

0reactions
billygriffincommented, Nov 13, 2019

Totally agree with your critique, it’s completely valid. We went back and forth on it and agree that there’s not a great answer, but ultimately decided that since Cancel will close the dialog, that behavior will be super confusing as well, and since it requires that a user explicitly tabs to the particular button prior to the click, they’ve signaled their intent sufficiently enough to depart from the macOS behavior in this very narrow case. Thanks again for the issue, it really helped us understand how to think about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keyboard: keydown and keyup
So if we want to track any input into an <input> field, then keyboard events are not enough. There's another event named input...
Read more >
Keyboard Input Overview - Win32 apps
Key location 101/102 Enhanced keyboard Scan 1 make Scan 1 break DO NOT USE 00 80 DO NOT USE E0_00 E0_80 1 ~ ` 29 A9...
Read more >
How to detect when cancel is clicked on file input?
This is logic to determine if not when. You could add it to the change listener but then you still have OP's main...
Read more >
Handling Events
Though we have ignored it so far, event handler functions are passed an argument: the event object. This object holds additional information about...
Read more >
Building a dialog component - web.dev
A foundational overview of how to build color-adaptive, responsive, and accessible mini and mega modals with the element.
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