Add name config option for form field submission in config-only mode - #10
Closed
BrijeshSajeev with Copilot wants to merge 1 commit into
Closed
Add name config option for form field submission in config-only mode#10BrijeshSajeev with Copilot wants to merge 1 commit into
name config option for form field submission in config-only mode#10BrijeshSajeev with Copilot wants to merge 1 commit into
Conversation
Copilot
AI
changed the title
[WIP] Fix x-selectra block missing form field name
Add Mar 9, 2026
name config option for form field submission in config-only mode
- When x-selectra is used in config-only mode (without a native <select> or <input> element), there was no form field name, making form submission impossible. This adds a `name` config option that auto-creates a hidden input element for form submission when no source element exists. Address code review: sync initial value and use flag for auto-created inputs - Set initial value on hidden input from pre-selected items - Use _createdHiddenInput flag to distinguish auto-created hidden inputs from user-provided ones in destroy() - The new feature is the name config option that auto-creates a hidden <input> for form submission when no source <select> element exists - add the name usage example to both READMEs and add a demo section to the examples page.
BrijeshSajeev
force-pushed
the
copilot/fix-x-selectra-no-form-field-name
branch
from
March 9, 2026 06:53
ac35681 to
4e0fdb1
Compare
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.
When
x-selectrais used without a native<select>or<input>inside (config-only mode),_sourceElis null and no value is submitted with forms.Adds a
nameconfig option that auto-creates a hidden<input>for form submission.Changes
selectize.js: Addname: nulltoDEFAULTS. In config-only init, create a hidden input with the configured name, sync initial value from pre-selected items, and track via_createdHiddenInputflag. Clean up indestroy().index.d.ts: Addname?: string | nulltoSelectraConfigREADME.md/src-alpine/README.md: Document in config tableUsage
This creates
<input type="hidden" name="country">inside the wrapper, kept in sync via the existing_syncSourceElement()path.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.