inferno: Selected attribute of option tags are not rendered
Observed Behaviour
Inferno is omitting selected attribute on <options> when rendering into DOM. Even when selected was set explicitly.
Expected Current Behaviour
Inferno should render the attribute when it is trueish.
Inferno Metadata
macOS, Chrome
Here is the repo with the issue: https://github.com/FQ400/inferno-playground
There is only one component (src/app/components/campaign-type-select). Tests can be run using npm run test. The expected test fails at the moment.
Maybe the issue is related to #773. But I am not sure.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21 (21 by maintainers)
Commits related to this issue
- Test case to verify default selected property of option. Related to #1031 — committed to DoumanAsh/inferno by DoumanAsh 7 years ago
- Test case to verify default selected property of option. Related to #1031 — committed to DoumanAsh/inferno by DoumanAsh 7 years ago
- Test case to verify default selected property of option. (#1032) Related to #1031 — committed to infernojs/inferno by DoumanAsh 7 years ago
In the DOM if you grab an element say
document.querySelector("option")then check itsel.selectedproperty it will reflect whatever inferno has set it to, this may not appear in the developer tools depending on the browsers implementation but the element will have itsselectedproperty set to what has been set.<option Selected={true}>...</option>works because inferno doesn’t recognised uppercasedSelectedas a native DOM property so instead of a fastoption.selected = trueit doesoption.setAttribute('Selected')which will then display in dev tools and since setAttribute also normalizes case it will also setoption.selectedto true.