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

Clean up provider.js #4009

Merged
merged 2 commits into from
Feb 13, 2025
Merged

Clean up provider.js #4009

merged 2 commits into from
Feb 13, 2025

Conversation

josemigallas
Copy link
Contributor

@josemigallas josemigallas self-assigned this Feb 10, 2025
@mayorova
Copy link
Contributor

I've got two concerns:

  1. I am not able to make the cucumber tests partials.feature and portlets.feature pass locally, despite running assets:clobber and assets:precompile multiple times. The behavior which causes a failure is that the button "New X" appears, but clicking on it doesn't open the dropdown.
  2. In the development server the button does work, and opens the dropdown list, however clicking on the arrow again doesn't collapse it. Only clicking outside of the button collapses it. I think the dropdown should close also when clicking again on the arrow button.

@mayorova
Copy link
Contributor

Some more info on these two concerns:

  1. I am not able to make the cucumber tests partials.feature and portlets.feature pass locally, despite running assets:clobber and assets:precompile multiple times. The behavior which causes a failure is that the button "New X" appears, but clicking on it doesn't open the dropdown.

Troubleshooting this further shows that for some reason the action find('.dropdown-toggle').click doesn't result in the correct element being clicked. Instead of $(document).on('click', '.dropdown-toggle', the $(document).on('click', 'body' event is triggered. Also, the arrow button gets highlighted (as when hovered over). Adding a second find('.dropdown-toggle').click in the step does click properly and opens the dropdown, but this is incorrect. Apparently this only happens locally? Could it be a bug in the chromedriver? 🤔 Any ideas? This just drives me nuts.

  1. In the development server the button does work, and opens the dropdown list, however clicking on the arrow again doesn't collapse it. Only clicking outside of the button collapses it. I think the dropdown should close also when clicking again on the arrow button.

I think this is because of calling closeAllDropdowns on clicking the toggle. So, it always first closes the expanded dropdown (in a bulk action), and then toggles the class again, hence always expanding it, and never collapsing. I've left some inline suggestions. Probably not to be applied directly, but you get the point - basically the closeAllDropdowns accepts an argument, and will close all dropdowns except the element passed to it.

@josemigallas josemigallas merged commit 1ee9a69 into master Feb 13, 2025
17 of 21 checks passed
@josemigallas josemigallas deleted the remove_provider_js branch February 13, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants