Closed (fixed)
Project:
Superfish Dropdown Menu
Version:
8.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2016 at 19:37 UTC
Updated:
19 May 2026 at 11:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mdeltito commentedAttached are two patches, one for the module (theme function) and one for the Drupal Superfish library (1.4.8)
Comment #3
mdeltito commentedComment #4
sitiveni commentedHi @mdeltito et al,
Added JS ARIA as separate library jQuery plugin file (aria.js - remove extension .txt as I wasn't able to upload a JS file) in order to make it configurable (enabled or not) in the superfish block options.
I also took the adding of the attributes out of the list item theme function and placed it in superfish build theme function as the other attributes are set there too. On top of that I set the role (menu for "ul" and menuitem for "li") as attribute.
I took guidance from Terril Thompson (http://terrillthompson.com/blog/202) for the ARIA attributes but kept your aria-expanded attribute too.
I did not consider expanded menus or when no theme is used (setting "use_item_theme" not set); so there is room to enhance. I basically implement for my requirements (bit selfish I know; time is of essence tho).
Thanks
Comment #5
zipymonkey commentedI rerolled this patch to work with most recent dev and superfish 2.0.
I also created a patch to the Superfish-for-Drupal library. I can make a pull request if the patch works.
https://github.com/zipymonkey/Superfish-for-Drupal/commit/cb6bb121e596dd...
Comment #6
zipymonkey commentedUploading a new version of the patch which does not contain debug messages.
Comment #7
schiavone commented@zipymonkey thanks for the patch. Successfully applied it to SuperFish Module 7.x-2.0 using 1.2 library. This needs to be rolled into dev branch!
Comment #8
stewestComment #9
ckngAttached patch for 8.x-1.x version.
Comment #11
lobsterr commentedThank you for contribution
Comment #14
lordzik commentedHello,
i would like to ask if those changes were correctly commited to 8.x branch as grep finds only one row with "aria-expanded" string in module's directory:
# grep -R aria-expanded *
templates/superfish-menu-items.html.twig: {{ item.link_menuparent|merge({'#attributes': {'role': 'menuitem', 'aria-haspopup': 'true', 'aria-expanded': 'false'}}) }}
And aria-expanded is not changing to "true" when menu is expanded - so this seems not to work.
Best regards