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

sl-select doesn't update label if sl-option label changes #1971

Open
Ryex opened this issue Apr 11, 2024 · 1 comment
Open

sl-select doesn't update label if sl-option label changes #1971

Ryex opened this issue Apr 11, 2024 · 1 comment
Labels
bug Things that aren't working right in the library.

Comments

@Ryex
Copy link

Ryex commented Apr 11, 2024

Describe the bug

At first I thought this was a regression on #729 but it seems it's more of a case where there are situations where the sl-option can change without the slotchange event firing.

To Reproduce

Steps to reproduce the behavior:

  1. render the sl-option 's from containing custom component state in a lit html template
  2. update custom component state
  3. menu item will change, select display label will not.

Demo

https://codepen.io/Ryex-the-bashful/pen/JjVZjZy

Screenshots

image

Browser / OS

tested latest Firefox and Edge

Additional information

I tried force an update but without sub classing adding a mutation observer I couldn't come up with a method

@Ryex Ryex added the bug Things that aren't working right in the library. label Apr 11, 2024
@KonnorRogers
Copy link
Collaborator

🤔 This is interesting. I think we would need a MutationObserver attached to <sl-select>

It seems like handleValueChange on <sl-select> can force an update.

https://codepen.io/paramagicdev/pen/MWRxXod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

2 participants