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

[🐞] Select Component Doesn't React to Disabled State Change #821

Closed
Toeler opened this issue Jun 4, 2024 · 1 comment · Fixed by #823
Closed

[🐞] Select Component Doesn't React to Disabled State Change #821

Toeler opened this issue Jun 4, 2024 · 1 comment · Fixed by #823
Labels
STATUS-1: needs triage This doesn't seem right TYPE: bug Something isn't working

Comments

@Toeler
Copy link

Toeler commented Jun 4, 2024

Which package is affected?

Headless Kit

Describe the bug

When changing the disabled attribute on a Select.Root component after the component has been created, the component state doesn't change to reflect the new value

Reproduction

https://stackblitz.com/edit/qwik-starter-msxbxx?file=src/routes/index.tsx

Steps to reproduce

  1. Click on the select button to confirm that no popover is displayed
  2. Uncheck the disabled checkbox
  3. Click on the select button

Expected:

  • The popover would display

Actual:

  • The popover doesn't display, the select is still in a disabled state

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @builder.io/qwik: ^1.4.3 => 1.5.5 
    @builder.io/qwik-city: ^1.4.3 => 1.4.3 
    @qwik-ui/headless: ^0.4.2 => 0.4.2 
    typescript: 5.3.3 => 5.3.3 
    undici: 5.28.2 => 5.28.2 
    vite: 4.5.2 => 4.5.2

Additional Information

This works in the reverse as well. Change the signal initial value to false (enabled) and then check the checkbox and the select also doesn't become disabled.

At a guess, it's because this is trying to track a boolean value and not a signal, so the task isn't firing after the first time:

    useTask$(({ track }) => {
      context.disabled = track(() => disabled);
    });
@Toeler Toeler added STATUS-1: needs triage This doesn't seem right TYPE: bug Something isn't working labels Jun 4, 2024
@thejackshelton thejackshelton mentioned this issue Jun 4, 2024
9 tasks
@thejackshelton
Copy link
Collaborator

Hey @Toeler! It should be fixed. The new patch release will be out tomorrow morning 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage This doesn't seem right TYPE: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants