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

2.18 regression: sl-select does not show selected values on first render #2254

Open
shonya3 opened this issue Nov 4, 2024 · 1 comment
Open
Labels
bug Things that aren't working right in the library.

Comments

@shonya3
Copy link

shonya3 commented Nov 4, 2024

Describe the bug

Select element does not show selected values on first render since 3.18.

Demo

I'll link two stackblitz demo. 2.17.1 - wihtout bug, and 2.18 - with bug(does not show values).

2.17.1 (values rendered) https://stackblitz.com/edit/vitejs-vite-q2mcgs?file=package.json,src%2Fhome-page.ts

2.18 (no values) https://stackblitz.com/edit/vitejs-vite-y9ciev?file=src%2Fhome-page.ts&terminal=dev
But if you await promise and request update, then values get rendered.
Uncomment this in 3.18 example in home-page.ts :

 // protected async firstUpdated() {
  //   await new Promise((r) => setTimeout(r));
  //   this.requestUpdate();
  // }

Screenshots

3.17.1
image

3.18
image

Browser / OS

  • OS: Windows 11
  • Browser: Chrome
  • Browser version: 130
@shonya3 shonya3 added the bug Things that aren't working right in the library. label Nov 4, 2024
@KonnorRogers
Copy link
Collaborator

Duplicate of #1570 (comment)

(going to leave this bug open since I never made a formal report)

Thanks, for the report, I'm looking into it. The TLDR is that the value property is being triggered before the element connects and Lit's lifecycle has started so it never toggles the valueHasChanged property.

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