framework/js
David Wheatley eaf1b86785
fix(a11y): add focus traps to modals and nav drawer (#3018)
* Add focus trap util

* Add focus trap to Modals

Fixes #2663

* Split tab press into `onTab` handler

* Remove deprecated code

* Use requestAnimationFrame instead of setTimeout

* Reduce code duplication

* Implement focus trap in nav drawer

Fixes #2665

* Hide drawer when window is resized to be bigger

Fixes issue where focus trap would remain on the drawer when it is
just the app header, if the drawer was opened then the window was
made larger.

* Simplify conditional function calls

* Fix modal focus trap

* Remove debug code

* Simplify resize handler conditional statements

* Add info about reasoning of resize handler

* Prefer native JS methods over jQuery

* Update conditional function call to handle `undefined`

* Expose screen sizes as CSS custom properties

* Use `window.matchMedia` rather than resize handler

* Fix spelling error

Co-authored-by: David Sevilla Martin <me@datitisev.me>

* Remove breaking change

Co-authored-by: David Sevilla Martin <me@datitisev.me>
2021-11-21 19:44:31 +00:00
..
.yarn/releases chore: migrate fully to Yarn (#3155) 2021-11-10 20:10:25 +00:00
dist Bundled output for commit d82ae27231 2021-11-19 17:46:08 +00:00
dist-typings Bundled output for commit d82ae27231 2021-11-19 17:46:08 +00:00
src fix(a11y): add focus traps to modals and nav drawer (#3018) 2021-11-21 19:44:31 +00:00
.bundlewatch.config.json Add bundlewatch to track bundle size changes in PRs (#2695) 2021-03-17 14:54:42 +00:00
.gitignore chore: migrate fully to Yarn (#3155) 2021-11-10 20:10:25 +00:00
.yarnrc.yml chore: migrate fully to Yarn (#3155) 2021-11-10 20:10:25 +00:00
admin.js Drop JS copyright blocks 2021-05-15 20:11:38 -04:00
forum.js Drop JS copyright blocks 2021-05-15 20:11:38 -04:00
package.json fix(a11y): add focus traps to modals and nav drawer (#3018) 2021-11-21 19:44:31 +00:00
tsconfig.json Update core to use new Webpack config, flarum-tsconfig, and build action (#2856) 2021-05-13 00:28:17 +01:00
webpack.config.js chore: migrate fully to Yarn (#3155) 2021-11-10 20:10:25 +00:00
yarn.lock fix(a11y): add focus traps to modals and nav drawer (#3018) 2021-11-21 19:44:31 +00:00