Content-Length: 284986 | pFad | http://github.com/sveltejs/svelte/issues/16030

A9 `select` with reactive `disabled` attribute hides the binded `value` · Issue #16030 · sveltejs/svelte · GitHub
Skip to content

select with reactive disabled attribute hides the binded value #16030

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

Closed
ivenuss opened this issue May 29, 2025 · 6 comments · Fixed by #16032
Closed

select with reactive disabled attribute hides the binded value #16030

ivenuss opened this issue May 29, 2025 · 6 comments · Fixed by #16032

Comments

@ivenuss
Copy link
Contributor

ivenuss commented May 29, 2025

Describe the bug

Might relate to: #16017.

After upgrading to 5.33.5 select with disabled state behaves unexpectedly.

When setting disabled attribute to select component (just a wrapper around select element), then the binded value suddenly disappears.

While reproducing the issue I figured out few things:

  • select has to be in separated file as component to reproduce it
  • if you remove the bind bind:value and change it to value={value} inside select component, it works
  • when I remove disabled prop from select component, it works

Reproduction

Broken >= 5.33.5

https://svelte.dev/playground/6d9f0dbfa2c74e8f88483dd90d0abfd6?version=5.33.7

Working < 5.33.5

https://svelte.dev/playground/6d9f0dbfa2c74e8f88483dd90d0abfd6?version=5.33.4

System Info

"svelte": "^5.33.7",
"@sveltejs/kit": "^2.21.1"

Severity

blocking an upgrade

@sorinpopescu
Copy link

Hi.
I can confirm.
Happen only with "disabled".

@paoloricciuti
Copy link
Member

Mmm it's weird that my PR broke this as this is a reactivity issue and I only touched the server code

@paoloricciuti
Copy link
Member

Oh yeah I suppose the culprit was actually #15961

@sorinpopescu
Copy link

When you render the pages with let userData = $state( ... and at some point you update the values, but the change is not reflected, instead it gets to empty no selected value.

This works
<Select id="currency" items={listCurrencies} bind:value={userData.currency} aria-label={translation?.profile?.currency ?? 'Currency'} placeholder={translation?.profile?.currency ?? 'Currency'} required underline={true} class={classInputField} />

this do not work

<Select id="currency" items={listCurrencies} bind:value={userData.currency} aria-label={translation?.profile?.currency ?? 'Currency'} placeholder={translation?.profile?.currency ?? 'Currency'} required underline={true} disabled={isLoading} class={classInputField} />

Thanks

@paoloricciuti
Copy link
Member

This two snippets are the same 😄 Btw i think i found the bug

@sorinpopescu
Copy link

Are not the same:
the first one that works do not have "disabled={isLoading}"
the second has that "disabled={isLoading}"

Looks like working in 5.33.8.

Thanks

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

Successfully merging a pull request may close this issue.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sveltejs/svelte/issues/16030

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy