-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reader context menu keyboard navigation #139
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,7 +175,11 @@ const AnnotationsView = memo(React.forwardRef((props, ref) => { | |
props.onUpdateAnnotations([annotation]); | ||
}, []); | ||
|
||
function handlePointerDown() { | ||
function handlePointerDown(event) { | ||
// Clicking on the rendered content when a contextmenu is open will | ||
// lead to pointerup event not firing and the annotation becoming not-selectable | ||
// via keyboard until it is clicked. | ||
if (event.target.classList.contains("context-menu-overlay")) return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to reproduce the mentioned issue. Could you help me with the steps to reproduce it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it actually is a bit harder to reproduce now than before. The recent fix to context menu focus regression must have helped. I did get to reproduce it with an unloaded reader tab. After it loads, click on the annotation Screen.Recording.2024-10-10.at.12.27.36.PM.movThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be fixed in 97dd5ab. Thanks for helping to reproduce it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's fixed now. That was definitely a less-roundabout way to do it! I removed this changed from here. |
||
pointerDownRef.current = true; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But where is this concept from? It feels pretty unexpected that pressing a letter immediately activates an action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be nice to skip an extra click or keypress if this is the only matching option. But you're right, the native menu does not do that, so it's probably best to stick to just focusing the menu item.