-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Desktop: Accessibility: Make click outside of dialog content be cancellable #11765
base: dev
Are you sure you want to change the base?
Conversation
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.
Thank you for working on this!
I've left a few comments.
Looking again at SC 2.5.2, it includes the following:
As such, it's possible that the |
I have trouble image how this would look like in our case since we are keeping track fo the mouse only to allow the users to close the dialog by clicking outside of the dialog content. E.g.: Clicking down on the background and moving the pointer to the "Ok" button would not trigger the button, but clicking down in the content and moving the pointer to the background would cause it to close (or at least try since depends on I think an alternative here would be to remove the functionality of closing dialog by clicking in the dimmed background. |
I also made another manual test with the NoteProperties:
This is related to your correction that my custom hook would never change state and never be triggered again if something like this happened. Thanks! |
} | ||
}; | ||
const mouseUpListener = (event: MouseEvent) => { | ||
if (!mouseDownOutsideContent) return; |
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.
if (!mouseDownOutsideContent) return; |
Optional: Since mouseDownOutsideContent
is a ref
, I think !mouseDownOutsideContent
should always be false
.
Related to #10795
Summary
It should be possible to cancel the action of clicking in the dimmed background. Before this PR it was only possible by moving the pointer outside of Joplin window.
I change this behaviour by keeping track of the mouseup and mousedown event, dismissing only if the click action is finished in the dimmed background and not inside the content of the dialog.
WCAG
Guideline: 2.5.2 Pointer Cancellation
Technique: Using native controls to ensure functionality is triggered on the up-event.
Testing
Test 1
Test 2
Test 3
Test 4
Test 5
Test 6