docbrown/app/javascript
Marcy Sutton f072730f0f
Header navigation dropdown accessibility (#11509)
* Improve keyboard a11y of header menu dropdown

This commit also includes some cleanup of unnecessary functions that seemed to degrade performance.

Closes https://github.com/forem/forem/issues/1154

* Add temporary focus style on navigation-button

* Put menu items in a list

* Adjust menu button based on VoiceOver testing

* Refactor menu logic to be reusable/work on touch

* Preserve admin link visibility

* Focus on first item on menu open

* Clean up some HTML and CSS

* Apply suggestions from code review

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Ensure menu hides on click outside

* Rename toggle function and adjust formatting

* Update nav button focus style

* Clean up padding on header avatar focus style

* Make button show focus state for keyboard only

Using .focus-visible:focus targets keyboard focus and eliminates a flash of the blue border on click before focus is moved to the child item (which also has no focus style on mouse click)

* Update app/views/layouts/_top_bar.html.erb

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Add some defensive programming

* Removed initializeTouchDevice from base.js.erb

* navigation-butt ID is now member-menu-button

* Moved all the logic from initializeTouchDevice.js into a pack file/utilities.

* committing re-ordered schema after setup

* add tests for initializeTouchDevice

* remove some unneeded html setup

* make sure menu doesn't close if user tabs back from sign out

* Revert "committing re-ordered schema after setup"

This reverts commit a41a1c861cca3b97d8a7b8a99268b8afaae9f028.

* optimized code

* small tweaks, only show outline when focused

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-01-27 09:39:17 +00:00
..
.storybook Storybook dropdown should be accessible 11724 (#12295) 2021-01-19 08:51:37 +00:00
actionsPanel Fix broken experience level button in moderation panel (#11797) 2020-12-08 10:20:35 +01:00
admin [2020 EOY Issue] Modal alert when enabling Auth Provider without keys (#12135) 2021-01-13 13:54:39 -05:00
analytics Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
article-form Close modal on escape keypress (#12428) 2021-01-26 15:12:54 +01:00
articles Remove non application files from frontend code coverage (#11752) 2020-12-04 20:00:20 -05:00
chat Report a Message in Connect (#12229) 2021-01-19 12:07:47 -05:00
CommentSubscription Remove non application files from frontend code coverage (#11752) 2020-12-04 20:00:20 -05:00
common-prop-types 🚀 Ability to allow tag moderators to create chat channels (#9741) 2020-12-08 13:10:36 +07:00
contentDisplayPolicy Fix and refactor hide user content (#12307) 2021-01-18 11:08:23 -05:00
crayons Close modal on escape keypress (#12428) 2021-01-26 15:12:54 +01:00
githubRepos Deprecate old button stylings with Crayons buttons (#10694) [deploy] 2020-10-14 07:28:41 -07:00
icons Storybook: Add DocsPage and test out static content (#11397) 2020-12-02 09:56:38 -08:00
leftSidebar [deploy] Fix tag display bug and crayonsify area (#10868) 2020-10-20 16:07:17 -04:00
listings Use anchor tag instead of button for edit/delete links (#12098) 2021-01-04 11:03:15 -05:00
modCenter Use faster JS selection methods (#11409) 2020-11-16 17:35:50 +01:00
onboarding Fixing link focus (#12362) 2021-01-22 09:26:51 -05:00
organization Fixed Error: Not implemented: window.computedStyle(elt, pseudoElt) console error in frontend tests. (#11633) 2020-11-26 16:55:33 -05:00
packs Header navigation dropdown accessibility (#11509) 2021-01-27 09:39:17 +00:00
podcasts Remove non application files from frontend code coverage (#11752) 2020-12-04 20:00:20 -05:00
profileDropdown Fix TypeError: userData is null in blockButton.js (#9299) 2020-07-14 07:28:53 -07:00
readingList Fix broken test pre-Preact upgrade (#12328) 2021-01-18 14:39:17 -05:00
responseTemplates Use faster JS selection methods (#11409) 2020-11-16 17:35:50 +01:00
Search Storybook: Add DocsPage and test out static content (#11397) 2020-12-02 09:56:38 -08:00
searchableItemList Filter by tags of reading list items not tags you follow (#11394) 2020-11-13 10:45:32 -05:00
shared/components Small clean ups in post form (#12113) 2021-01-05 08:52:36 -05:00
sidebar-widget Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
Snackbar Storybook: Add DocsPage and test out static content (#11397) 2020-12-02 09:56:38 -08:00
topNavigation Header navigation dropdown accessibility (#11509) 2021-01-27 09:39:17 +00:00
utilities Prep work to sync mobile search in #10424 (#11525) 2020-11-30 06:13:06 -05:00
.eslintrc.js Added a comment mentioning that index.js overrides are for barrel files (#8978) 2020-06-29 10:52:35 -04:00
netlify.toml Update Netlify config to handle stylesheet changes for Storybook (#9753) 2020-08-12 11:02:14 -04:00