pacocoursey / cmdk

Fast, unstyled command menu React component.
https://cmdk.paco.me
MIT License
9.42k stars 266 forks source link

fix: attempt to prevent exceeding ResizeObserver loop limit #65

Closed Simek closed 1 year ago

Simek commented 1 year ago

Why

Hopefully should fix #64

How

As stated in the WICG discussion, the workaround to prevent the infinite loops is to call the observer logic within the requestAnimationFrame.

So, this changeset do just that and adds cancelAnimationFrame call to the observer cleanup phase.

Test Plan

Since I'm not sure how to reproduce this locally I have only run the existing tests and launched website locally to confirm that I cannot spot any regression.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cmdk-website ✅ Ready (Inspect) Visit Preview Nov 24, 2022 at 9:57AM (UTC)