-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Problem
I'm pretty sure this is entirely a Firefox problem, but I'm wondering if there is a workaround in yew:
When using a <button type="button"> to reset <select> elements to some <option>, Firefox will update the DOM to set the desired option as selected, but doesn't update the dropdown menu. Every other browser I have tried updates the dropdown as expected, but Firefox does not.
If the <select> element is in a <form>, I can use a <button type="reset"> to reset the dropdown as expected, but any <input type="text"> elements in the form are set to empty this way. I'm trying to reset other inputs to some default value.
Playground demo here:
https://play.yew.rs/?shared=6L0N4GKLcjf9eIGONTT5
Demo repo here:
https://github.com/ryanobeirne/yew-select-firefox
Steps To Reproduce
- Create a
<select>element - Use a
<button type="button">with anonclickevent to change the selected value - DOM changes, but document does not
Expected behavior
I would expect that when the Reset button is clicked, the dropdown menu resets to the selected option.
Environment:
- Yew version:
0.21.0 - Rust version:
1.81.0 stable - Target:
wsm32-unknown-unknown - Build tool:
trunk - OS: tried on
MacOSandLinux - Browsers:
Firefox: (MacOS aarch64 v131.0, Ubuntu 64-bit v128.0, ArchLinux 64-bit 129.0.2) - Works as expected on Safari, Opera, Chrome
Questionnaire
- I'm interested in fixing this myself but don't know where to start
- I would like to fix and I have a solution
- I don't have time to fix this right now, but maybe later
