Repository navigation
Support controlled select values behind an opt-in define - #10
Merged
Merged
Conversation
Member
|
I'm a bit split about this. Setting aside my distaste for React so often deviating from the DOM APIs, the bigger issue is that it invites code that is incompatible with:
Will see if Claude can solve the latter. Otherwise I would put this under a define, so that users opt into the stumbling block. |
serjek
marked this pull request as draft
October 23, 2026 17:38
Contributor
Author
|
Yes good point! I see if we can avoid this change at all. |
coconut.vdom and coconut.html now support it the same way, so the templates stay portable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
back2dos
marked this pull request as ready for review
October 25, 2026 11:04
Member
|
Works fine now. It was just a bit finnicky for coconut.html. The v1 branch goes through strings and tries to flatten as much as possible at compile time, so select and option needed an exemption, but it turned out quite claudable. |
Contributor
Author
|
Thanks! |
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.
Controlled
<select value="...">templates currently fail to compile because React'svalueprop is absent from the HTML select attributes supplied bytink_domspec.Add
-D coconut_react_dom_select_valueto opt into a selectvalueprop accepting a string or an array of strings for multiple selection. This allows selection to follow application state, including programmatic resets. Default behavior stays unchanged.The define and README make the portability limitation explicit:
coconut.htmlandcoconut.vdomuseselectedon individual options and cannot consume these templates unchanged.Validation: ordinary selects compile without the define; controlled single and multiple selects compile with it; controlled values are rejected without it. The consuming frontend's browser integration checks previously covered controlled select resets and reactive inputs.
ARIA definitions remain in
tink_domspec, covered separately by tink_domspec PR #43.