Skip to content

Fixed #17652 - don't break company drop-down with modals#18396

Merged
snipe merged 1 commit intogrokability:developfrom
uberbrady:fix_select2_break_on_modal
Jan 5, 2026
Merged

Fixed #17652 - don't break company drop-down with modals#18396
snipe merged 1 commit intogrokability:developfrom
uberbrady:fix_select2_break_on_modal

Conversation

@uberbrady
Copy link
Copy Markdown
Member

So the Company-select partial that we use is used not only in Create Asset, but also in the modal, for when you create either a user for the asset to be checked-out to, or if you create a default location for it to be assigned-to.

So, to fix that, I just removed ID from the company select in the partials. That seems like a bit of a 'harsh' fix, but I couldn't find anywhere in the code where we actually used the ID of the company select for anything. So instead of writing some kind of weird stuff that would dynamically name the ID, with some kind of reasonable fallback - I just pulled it out completely.

Before this fix, opening up the 'create' modal for either creating a user or for creating a default location would break the company drop-down in the 'parent' form. After the fix, both use cases no longer break the company drop-down.

I made sure to confirm that the modals javascript that we use just does a default "form-serialize" (which is based on element name, not based on id), so it should not be affected.

Fixes #17652

@uberbrady uberbrady requested a review from snipe as a code owner January 5, 2026 16:46
@uberbrady uberbrady linked an issue Jan 5, 2026 that may be closed by this pull request
@uberbrady
Copy link
Copy Markdown
Member Author

I've tested those modals and they do seem to continue to work, creating the appropriate things and assigning them to the new asset.

@snipe snipe merged commit b4b9339 into grokability:develop Jan 5, 2026
8 checks passed
@uberbrady
Copy link
Copy Markdown
Member Author

Side note - I also checked this against Accessories, where I could also reproduce the bug (this time, with the new 'Location' modal). And this fix fixes that too.

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.

Visual glitch - Company Select2 breaks on new user creation modal

2 participants