Skip to content

Commit

Permalink
[chore] readd setAppElement example
Browse files Browse the repository at this point in the history
  • Loading branch information
neilhsmith committed Apr 8, 2023
1 parent 1520830 commit 0339ed5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ There are several demos hosted on [CodePen](https://codepen.io) which
demonstrate various features of react-modal:

* [Minimal example](https://codepen.io/neilhsmith/pen/QWVVEEg)
* [Using setAppElement](https://codepen.io/neilhsmith/pen/JjmoaOV)
* [Using onRequestClose](https://codepen.io/neilhsmith/pen/OJooXBg)
* [Using shouldCloseOnOverlayClick](https://codepen.io/neilhsmith/pen/wvEYxKa)
* [Using inline styles](https://codepen.io/neilhsmith/pen/gOdZPPP)
Expand Down
7 changes: 7 additions & 0 deletions docs/examples/set_app_element.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Using setAppElement

This example shows how to use setAppElement to properly hide your application from screenreaders and other assistive technologies while the modal is open.

You'll notice in this example that the aria-hidden attribute is applied to the #main div rather than the document body.

[setAppElement example](https://codepen.io/neilhsmith/pen/JjmoaOV)

0 comments on commit 0339ed5

Please sign in to comment.