Skip to content
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

Firefox doesn't update <select> elements via means other than selection #3745

Open
1 of 3 tasks
ryanobeirne opened this issue Oct 9, 2024 · 0 comments
Open
1 of 3 tasks

Comments

@ryanobeirne
Copy link

ryanobeirne commented Oct 9, 2024

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

  1. Create a <select> element
  2. Use a <button type="button"> with an onclick event to change the selected value
  3. 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.

Screenshots
Firefox Screen Recording

Environment:

  • Yew version: 0.21.0
  • Rust version: 1.81.0 stable
  • Target: wsm32-unknown-unknown
  • Build tool: trunk
  • OS: tried on MacOS and Linux
  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant