Skip to content

Bug: New Customizable Select: option containing span, Select containing button causes hydration warning #33038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fkaempfer opened this issue Apr 28, 2025 · 0 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@fkaempfer
Copy link

Customizable select elements have received support in Chromium 134:
https://developer.chrome.com/blog/a-customizable-select
https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Customizable_select

Creating selects with appearance base-select work fine in React, however an error is logged in dev mode in validating DOM nesting.

In HTML, <span> cannot be a child of <option>.
This will cause a hydration error.

and

In HTML, <button> cannot be a child of <select>.
This will cause a hydration error.

React version: 19.1.0

Steps To Reproduce

  1. Copy the example from MDN into a react project, or use my code sandbox
  2. Open dev tools
  3. Observe the warning

Link to code example:
https://codesandbox.io/p/sandbox/quiet-cdn-ylm323?file=%2Fsrc%2FApp.js%3A9%2C59

The current behavior

A hydration warning is logged

The expected behavior

No error logged, no hydration errors should be happening (?)

@fkaempfer fkaempfer added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

1 participant