huntabyte / bits-ui

The headless components for Svelte.
https://bits-ui.com
MIT License
1.35k stars 95 forks source link

next: Select component freeze after selecting #921

Closed RMalik777 closed 2 weeks ago

RMalik777 commented 2 weeks ago

Describe the bug

Select Component freezes after selecting an item inside the Select Content. The value is updated but the page needed to be refreshed to fix the freezing component. This behavior only present in 1.0.0-next.54 and not present in 1.0.0-next.53

Maybe related #919

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-mkbbzg?file=README.md

Logs

Uncaught Svelte error: effect_update_depth_exceeded
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops

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:
    @sveltejs/kit: ^2.0.0 => 2.8.1 
    bits-ui: ^1.0.0-next.54 => 1.0.0-next.54 
    svelte: ^5.0.0 => 5.1.16

Severity

annoyance

huntabyte commented 2 weeks ago

Definitely related to #919.

I'll look into this today. Thanks for raising the issue with a reproduction.

huntabyte commented 2 weeks ago

Alright this is driving me a bit mad that I'm unable to reproduce it in the Bits UI docs. It doesn't appear you're doing anything special in your repro and I can see it there.

Checking to ensure all the versions are aligned in the repro / Bits UI docs

huntabyte commented 2 weeks ago

Alright... after using the process of elimination, this issue only occurs when there is an animation/transition on the Select.Content

huntabyte commented 2 weeks ago

Fixed in the latest release of bits-ui@next (being released now)

RMalik777 commented 2 weeks ago

Can confirm it is now fixed. Thanks for the quick fix.