docs: add a warning for Customizable select elements
#40400
Merged
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
This PR adds a warning to the
Customizable select elements
article to warn about the fact that those features are not widely available.Motivation
The way this article is presented and described make it seems like this is the modern, generally available way to style selects ( sveltejs/svelte#15617 (comment) ). This couldn't be further from being true as this is only available in Chrome. Furthermore since the changes to the parser (again only available in Chrome) most Javascript frameworks that handle hydration will either prevent you from writing such code (like Svelte and Solid) or even worse just straight up fail hydration. It will also probably be a while before frameworks can adapt since they basically need to branch their hydration logic based on the availability of this feature.
I'm open to rephrase this if it's too scary but i think we should have some sort of warning here.
Related issues and pull requests
sveltejs/svelte#15963
sveltejs/svelte#15617