SIGN IN SIGN UP
honojs / hono UNCLAIMED

Web framework built on Web Standards

0 0 78 TypeScript

fix(jsx/dom): apply select value after children are rendered (#4847)

* fix(jsx/dom): apply select value after children are rendered

When options and value were set simultaneously on a select element,
the value was applied before option children existed in the DOM,
causing selectedIndex to fall back to 0.

Defer select value assignment to after children rendering, similar
to Preact's approach. This ensures options exist in the DOM before
value matching, while other props like `multiple` are still applied
before children.

* fix(jsx/dom): fix select value sync edge cases

For multiple selects with no matching option, selectedIndex was
incorrectly forced to 0. Only reset selectedIndex for single
selects, preserving the browser's default -1 for unmatched
multiple selects.

* perf(jsx/dom): use child.tag instead of el.nodeName for select check

Avoid DOM property access in the hot render loop by checking the
JSX node's tag property directly.
T
Taku Amano committed
75b4308496d64aed39e96fc105db233bde3d29b3
Parent: f47b559
Committed by GitHub <noreply@github.com> on 3/31/2026, 12:40:10 AM