Closed AleksandrHovhannisyan closed 2 years ago
Description
When using next-plugin-preact, <option> elements are given a duplicate selected attribute in the document source, resulting in HTML validation errors when run through a tool like https://validator.w3.org/.
<option>
selected
Steps to reproduce
Ctrl+U
<option selected value="b" selected>b</option>
Duplicate attribute selected.
The source code for the repro sandbox is very simple:
const values = ["a", "b", "c"]; export default function Home() { return ( <label> Pick a value <select defaultValue={values[1]}> {values.map((value) => ( <option key={value} value={value}> {value} </option> ))} </select> </label> ); }
Environment
Additional context
This may actually be a preact-render-to-string issue. Similar bug reported here: https://github.com/preactjs/preact-render-to-string/issues/208
Description
When using next-plugin-preact,
<option>
elements are given a duplicateselected
attribute in the document source, resulting in HTML validation errors when run through a tool like https://validator.w3.org/.Steps to reproduce
Ctrl+U
on Windows).selected
.<option selected value="b" selected>b</option>
.Duplicate attribute selected.
The source code for the repro sandbox is very simple:
Environment
Additional context