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

Fixes #38237 - select2 search not working in modals #10456

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

MariaAga
Copy link
Member

This is a problem in the foreman-discovery plugin, but I thought its best to put it in core in case there are more places with this issue
I think its safe to assume that if its a select2 inside a modal the parent class name will be "modal"
$(document.body); is the default value in select2
https://select2.org/dropdown#dropdown-placement
to reproduce: When selecting the Provision option for a discovered host, the system prompts for "Select initial host properties" such as Host Group, Organization, and Location. However, when clicking on the dropdown menus for these fields and attempting to filter values by typing, the functionality does not work—essentially, input cannot be typed into the filter field.

@github-actions github-actions bot added the Legacy JS PRs making changes in the legacy Javascript stack label Feb 24, 2025
@ShimShtein
Copy link
Member

Makes sense to me

@stejskalleos stejskalleos self-assigned this Feb 25, 2025
@MariaAga
Copy link
Member Author

I ran tests locally and they run ok, is the failures related with the github testing?

@ekohl
Copy link
Member

ekohl commented Feb 25, 2025

For some reason they ran for 5 hours and then timed out. I wonder if some page is just "frozen"

@MariaAga
Copy link
Member Author

For some reason they ran for 5 hours and then timed out. I wonder if some page is just "frozen"

Wouldnt that mean that the test would have failed in other prs for the same reason? @ekohl

@ekohl
Copy link
Member

ekohl commented Feb 25, 2025

Not if this PR in particular is introducing the breakage somewhere.

@MariaAga
Copy link
Member Author

MariaAga commented Feb 25, 2025

Not if this PR in particular is introducing the breakage somewhere.

I ran tests locally and they run ok, is the failures related with the github testing?

so my question is how can I make my local env more like the github env to see the failures? @ekohl
I ran rake assets:clobber and webpack compile before running them
EDIT: nvm some test started failing in the second run

@MariaAga
Copy link
Member Author

Working on fixing the tests, taking a while since they dont show up with DEBUG_JS_TEST=1

@stejskalleos stejskalleos self-requested a review February 26, 2025 11:40
@@ -27,7 +27,7 @@ function show_interface_modal(modal_content) {
modal_window
.find('.modal-title')
.text(__('Interface') + ' ' + String(identifier));
modal_window.modal({ show: true });
modal_window.modal({ show: true , backdrop: 'static'});
Copy link
Member Author

Choose a reason for hiding this comment

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

Somehow because of the select parent change, if its inside a modal, there is, a pixel in the select in the modal, that if a user clicks on at the right timing, closes the modal as its somehow outside the modal.
This makes is so the modal isnt closed on a click out side (only by clicking the X/save/cancel buttons)
other modal in the hosts page already has it $('#host-conflicts-modal').modal({ show: 'true', backdrop: 'static' });

Copy link
Member Author

@MariaAga MariaAga Feb 26, 2025

Choose a reason for hiding this comment

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

The tests, while running in normal, in headless mode, some how click this pixel in the second select in the interface modal, and close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Legacy JS PRs making changes in the legacy Javascript stack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants