Skip to content
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

feat(mega-menu): Adding aria-describedby in info link - FRONT-4520 #3486

Merged
merged 12 commits into from
Jul 16, 2024

Conversation

planctus
Copy link
Collaborator

@planctus planctus commented Jul 15, 2024

  • add aria-describedby in the info item title
  • add support of "space" to open menu items

@planctus planctus changed the title feat(mega-menu): Adding aria-descrbiedby in info link - FRONT-4520 feat(mega-menu): Adding aria-describedby in info link - FRONT-4520 Jul 15, 2024
Copy link

github-actions bot commented Jul 15, 2024

@github-actions github-actions bot temporarily deployed to pull request July 15, 2024 12:45 Inactive
@@ -36,6 +36,7 @@ module.exports = {
path: exampleLink,
info: {
title: 'About the News and Media',
title_id: 'about-the-news-id',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need to set a new parameter for this? Couldn't we just generate a unique id based on the global mega menu id?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the usual situation where we need to generate ids but we cannot use those for the tests, if you prefer i can remove these from the specs and only add them in the tests, in the template if this is not provided an automatic id is generated

@github-actions github-actions bot temporarily deployed to pull request July 16, 2024 07:00 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 16, 2024 07:10 Inactive
@emeryro
Copy link
Contributor

emeryro commented Jul 16, 2024

Well, my point was: instead of using random ids, can't we generate it based on the id provided to the menu item?
Something similar to what is done a few lines before
image
If I'm not wrong, there is just one featured title, so we could have _id ~ "-featured-title" for instance

@emeryro
Copy link
Contributor

emeryro commented Jul 16, 2024

I may be mixing up things a little, as the id has to be set on the menu item title, but you get the idea

@github-actions github-actions bot temporarily deployed to pull request July 16, 2024 08:53 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 16, 2024 09:11 Inactive
@planctus
Copy link
Collaborator Author

I've added support for using Space on the menu items in this pull request.

@github-actions github-actions bot temporarily deployed to pull request July 16, 2024 09:24 Inactive
@emeryro
Copy link
Contributor

emeryro commented Jul 16, 2024

This id are fine 👍, but now there is a small issue with the space behavior.
You can open the menu item, but not close it with space

…y into FRONT-4520-Yuppy-uh-id-and-aria-desribed-by-hurra
…ithub.com:ec-europa/europa-component-library into FRONT-4520-Yuppy-uh-id-and-aria-desribed-by-hurra
@planctus
Copy link
Collaborator Author

To be honest there was no intention to have a further action pressing again on the space bar. When you click Enter, for instance, a following press on it will not close the dropdown, it will instead behave as the Tab. Anyway, now we perform a click on the element when using the space bar, so it behaves as if it was clicked.

@github-actions github-actions bot temporarily deployed to pull request July 16, 2024 10:57 Inactive
@emeryro emeryro merged commit c1f923a into v4-dev Jul 16, 2024
7 checks passed
@emeryro emeryro deleted the FRONT-4520-Yuppy-uh-id-and-aria-desribed-by-hurra branch July 16, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants