Skip to content

Fixed issue .ui-state-focus missing from main navigation in 2.4.5 and 2.4.6 #37571

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

Closed
wants to merge 2 commits into from

Conversation

rostilos
Copy link
Contributor

@rostilos rostilos commented Jun 2, 2023

Description (*)

The bug was reproduced because the updated version of jquery-ui menu widget now adds the "ui-state-active" class instead of "ui-state-focus" to the element with focus. When the jquery-ui library was updated (somewhere between version 2.4.3 and 2.4.5) these edits were added but the styles were not changed.
In this PR, the selectors for the "ui-state-focus" class have been replaced by "ui-state-active" because the "ui-state-focus" class is no longer added to the menu item with focus in the menu functionality of the jquery-ui library widget

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes .ui-state-focus missing from main navigation in 2.4.5 and 2.4.6 #37300

Manual testing scenarios (*)

  1. Install a vanilla Magento version 2.4.5 - 2.4.6
  2. Open developer tools and inspect a submenu item in the main navigation to watch classes
  3. Using keyboard tab to the main menu then use arrow keys to navigate to submenu items
  4. When focus is on a menu/submenu item a class should be added of "ui-state-focus" ( Also the menu item with focus must be visually marked )

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jun 2, 2023

Hi @rostilos. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.

Add the comment under your pull request to deploy test or vanilla Magento instance:
  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@m2-github-services m2-github-services added Partner: Perspective partners-contribution Pull Request is created by Magento Partner labels Jun 2, 2023
@m2-community-project m2-community-project bot added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: pending review labels Jun 2, 2023
@rostilos
Copy link
Contributor Author

rostilos commented Jun 2, 2023

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@rostilos rostilos marked this pull request as draft June 2, 2023 16:14
@rostilos rostilos force-pushed the fix-for-issue-37300 branch from 47fb356 to 65fc2ca Compare June 2, 2023 16:22
@rostilos rostilos marked this pull request as ready for review June 2, 2023 16:25
@rostilos
Copy link
Contributor Author

rostilos commented Jun 2, 2023

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@schizek
Copy link

schizek commented Jun 27, 2023

@rostilos I don't think just styling the ui-state-active class will work here since active and focus have different meanings. In this case, if you put focus on a child menu item, the parent item is still "active", so the styles would apply to both which will be an issue. Ideally the ui-state-focus class would return so that could be styled separately from ui-state-active.

@rostilos
Copy link
Contributor Author

rostilos commented Jul 10, 2023

@schizek
A jquery-ui menu widget is used for the menu functionality. The current version's widget functionality contains a method that adds a ui-state-active class for active menu items, and for items in focus ( jQuery UI Menu 1.13.1 ) :
2023-07-10_17-38
Is it really necessary to rewrite the root functionality of a third-party widget if it's only about the class name?
In previous versions of the widget, this method actually added the ui-state-focus class to the element in focus ( jQuery UI Menu - v1.10.4) :
2023-07-10_17-39

And yes, both the parent component and the child component are given the same class. This may not be correct, but is it worth rewriting the core functionality with a plugin to do this? If this is an acceptable option, I can do it this way as it was in an older version, just clarifying.

@sinhaparul sinhaparul added the Project: Community Picked PRs upvoted by the community label Oct 13, 2023
@engcom-Hotel
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

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

Hello @rostilos,

Thanks for the contribution!

Please review my comment below.

Thanks

@@ -99,7 +99,7 @@

&.active {
.all-category {
.ui-state-focus {
.ui-state-active {
Copy link
Contributor

@engcom-Hotel engcom-Hotel Oct 25, 2023

Choose a reason for hiding this comment

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

We can change the class name in backward-compatible way like the below:

.ui-state-active, .ui-state-focus

@engcom-Echo
Copy link
Contributor

engcom-Echo commented Oct 31, 2023

@rostilos

We have verify PR changes and follow steps for verification mentioned here. But with PR when focus is on a menu/submenu item a class should be added of "ui-state-focus" ( Also the menu item with focus must be visually marked ) does not work.

Please have a look at below video and let us know if we have missed anything here

screen-capture.1.mp4

@engcom-Echo
Copy link
Contributor

@rostilos moving it on hold on the basis of above comment

@engcom-Echo
Copy link
Contributor

engcom-Echo commented Nov 15, 2023

@rostilos did you get a chance to have a look on comment?

@rostilos
Copy link
Contributor Author

@engcom-Echo Yes, I have looked at it, and will try to fix it as soon as possible, can't spare the time right now, but will give an update soon. Thanks

@engcom-Echo
Copy link
Contributor

@rostilos did you get a chance to have a look on #37571 (comment)?

@engcom-Echo
Copy link
Contributor

As PR need some work to be done based on #37571 (comment) Moving this PR in draft state.

@engcom-Echo engcom-Echo marked this pull request as draft January 2, 2024 04:54
@engcom-Echo
Copy link
Contributor

@rostilos We are closing this PR for now as it require some changes based on comment
Once you are ready please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Perspective partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Project: Community Picked PRs upvoted by the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.ui-state-focus missing from main navigation in 2.4.5 and 2.4.6
6 participants