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-menu-item label changes #729

Closed
bunesk opened this issue Apr 14, 2022 · 2 comments
Closed

sl-select doesn't update label if sl-menu-item label changes #729

bunesk opened this issue Apr 14, 2022 · 2 comments
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@bunesk
Copy link
Contributor

bunesk commented Apr 14, 2022

Describe the bug

If you have a sl-select with some sl-menu-item within and the label/slot of the selected sl-menu-item changes it won't be updated on the sl-select.

To Reproduce

Steps to reproduce the behavior:

  1. Create a SlSelect with some options
  2. Change the label of the selected SlMenuItem

Demo

https://codepen.io/buni48/pen/PoOKLbQ

@bunesk bunesk added the bug Things that aren't working right in the library. label Apr 14, 2022
@claviska
Copy link
Member

This has been fixed in caaf2b0. I also added a test to prevent regressions.

While fixing this, I was also able to improve performance slightly, as menu items are now cached on slotchange rather than fetched multiple times throughout the component's lifecycle. I'll probably make similar changes to remaining components that follow the same pattern.

@bunesk
Copy link
Contributor Author

bunesk commented Apr 14, 2022

Sounds great. Thank you.

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