-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow links in Plugins group in the More Menu #12309
Conversation
packages/edit-post/src/components/header/plugin-more-menu-item/index.js
Outdated
Show resolved
Hide resolved
Works great here. This way a plugin can add a (simple) link to the menu when needed, or specify a callback for the This "opens up" the menu for plugins and makes it very easy to use. Tested with different settings and in Chrome, Firefox and Edge on Win10. All works well. |
- Update the UI for user settings. - Add some caching of the options. - Add a plugin to add submenu item in the Block Editor. Requires WordPress/gutenberg#12309 to be merged. - Some cleanup.
68491d0
to
f568fba
Compare
@youknowriad - I addressed your feedback to make I also added docs and tests, PR should be ready to go. |
packages/edit-post/src/components/header/plugin-more-menu-item/index.js
Outdated
Show resolved
Hide resolved
7019545
to
d24cabf
Compare
d24cabf
to
75c6e05
Compare
75c6e05
to
b1069fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me accessibility-wise! Just a little comment about docs, really 😄
Looks good to me. ARIA menu items can be used for links. References: https://www.w3.org/TR/wai-aria-1.1/#menu Navigation Menubar Example: It would be really nice to not allow developers to use
and this is bad for semantics and accessibility. A button should be used instead. Also a value like |
It would be interesting to explore whether we could detect using a hash pointing to the same url and render a button instead of an anchor. We might want to use |
- Update the UI for user settings. - Add some caching of the options. - Add a plugin to add submenu item in the Block Editor. Requires WordPress/gutenberg#12309 to be merged. - Some cleanup.
Description
Fixes #11570.
It also includes an option to pass
url
which turns the menu item into a link.How has this been tested?
Copy those snippets into JS console and make sure that there are new items added in More Menu. Make sure it produces a valid HTML which follows accessibility guidelines:
button
for items withonClick
link
for items withurl
Screenshots
TODO
PluginMoreMenuItem
(similar to what we have here)New e2e tests (similar to what we have here)it's indirectly tested by the sidebar menu item which uses this new component behind the scenesChecklist: