docbrown/app
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
..
assets Header navigation dropdown accessibility (#11509) 2021-01-27 09:39:17 +00:00
black_box Small adjustment to blackbox.rb (#10961) 2020-10-20 21:14:56 -04:00
controllers Optimize column selection for articles belonging to "any" given tag (#12420) 2021-01-25 17:34:10 +01:00
decorators Improve cumulative layout shift on comment reactions + optimizations (#12309) 2021-01-18 19:29:44 -05:00
errors
helpers Prevent text overflow of follow button (#12422) 2021-01-25 17:29:10 +01:00
javascript Header navigation dropdown accessibility (#11509) 2021-01-27 09:39:17 +00:00
lib generalise sidebar campaign published article timeframe (#12278) 2021-01-19 08:40:39 -06:00
liquid_tags Bump liquid from 4.0.3 to 5.0.0 (#12150) 2021-01-15 15:37:42 -06:00
mailers Replace collective_noun with community_name (#11846) [deploy] 2020-12-28 09:34:17 -07:00
middlewares Move TimeZoneSetter middleware in proper place (#11336) 2020-11-09 17:11:10 +01:00
models Add validations to SiteConfig model (#12341) 2021-01-26 09:12:24 +07:00
policies Verify current password on password change (#12174) 2021-01-21 12:40:54 +07:00
queries/admin Filter by a few other roles when adding potential mods (#11187) 2020-11-02 15:05:19 -05:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Video max width (#12436) 2021-01-26 15:12:37 +01:00
serializers Reindex comments' Elasticsearch doc when commentable is updated (#12330) 2021-01-20 09:44:59 -05:00
services Fix failure on blank image URLs passed from oauth (#12390) 2021-01-27 09:34:19 +01:00
uploaders
validators Add validations to SiteConfig model (#12341) 2021-01-26 09:12:24 +07:00
view_objects Move GeneratedImage to Images::GenerateSocialmage (#11691) 2020-12-02 11:03:14 +07:00
views Header navigation dropdown accessibility (#11509) 2021-01-27 09:39:17 +00:00
workers Save Data Update Script errors to database and show them on http://localhost:3000/admin/data_update_scripts (#12348) 2021-01-21 14:48:34 +01:00