Repository navigation
Conversation
…3281) - Check for an existing hidden input preceding the toggle or in parent element before creating a new one. - Synchronize initial selection from existing hidden input value when present. - Preserve pre-existing hidden inputs and their validation attributes on dispose, only removing auto-created inputs. - Add unit test coverage for existing hidden input reuse and disposal preservation. - Document pre-existing hidden input support in combobox documentation. Fixes twbs#43281 Signed-off-by: Aryan Sachin <aryansachinixd@gmail.com>
…e budget Signed-off-by: Aryan Sachin <aryansachinixd@gmail.com>
✅ Deploy Preview for twbs-bootstrap ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a Combobox is placed in a server-rendered form or within a data grid, developers often provide a hidden
<input>element with specific attributes (e.g.id, custom validation classes likeis-invalid, or an initialvalue).Currently,
Comboboxunconditionally creates a new<input type="hidden">before the toggle and removes it when.dispose()is called. In dynamic workflows (such as updating rows or menus via AJAX), calling.dispose()removes the consumer's provided hidden input and discards custom validation states and attributes.This PR addresses #43281 by:
_createHiddenInput(), checking for an existing hidden input preceding the toggle or in its parent container before creating a new one._createdHiddenInput). When.dispose()is called, only auto-created hidden inputs are removed from the DOM; pre-existing inputs, their IDs, and validation classes are preserved.site/src/content/docs/forms/combobox.mdx.Fixes #43281