Add prop to toggle backdrop#10
Open
shawngustaw wants to merge 1 commit into
Open
Conversation
woofers
force-pushed
the
main
branch
11 times, most recently
from
July 7, 2024 07:19
c99009f to
fc6b857
Compare
woofers
reviewed
Jul 11, 2024
| {...bindEvents({ closeOnTap: true })} | ||
| ></div> | ||
| )} | ||
| <TrapFocus> |
Owner
There was a problem hiding this comment.
If showBackDrop is enabled, the TrapFocus component should not be applied to allow keyboard nav behind the dialog
woofers
self-requested a review
July 11, 2024 03:05
woofers
requested changes
Jul 11, 2024
woofers
left a comment
Owner
There was a problem hiding this comment.
Thanks for the contribution @shawngustaw. I think the idea behind the prop makes sense but I think a few more changes will be required to preserve accessibility and ensure the content behind the modal is actually intractable.
- The
useAriaHiddenhook will need to be disabled and not applyaria-hiddento the backdrop. -- https://github.com/woofers/react-sheet-slide/blob/e97d06bb8d5c9d593788e34fdd92cf8e9089783e/src/hooks/use-aria-hidden.ts TrapFocusshould be removed whenshowBackDropis set to allow keyboard nav- The CSS styles will likely need to be adjusted with
pointer-events: autoandpointer-events: noneto allow interactions behind the dialog - Optional: You may want to remove the logic that locks scrollbars while the modal is open when
showBackDrop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will allow you to interact with anything underneath the modal.