timc1/kbar

Closing kbar triggers scroll to bottom of page

terabyte128 opened this issue · 2 comments

I'm having a super weird issue with kbar that I'm out of ideas for how to troubleshoot. On this website, on Safari for macOS 16.2, closing the kbar either via pressing Escape or clicking outside of it, scrolls the window to the bottom of the page.

I haven't been able to reproduce this behavior with any other website or any other browser. I've attempted to eliminate as much other CSS and JS as possible from the page to narrow down the issue, and I haven't been able to get anywhere.

I'm wondering if you might have any ideas for what could be causing this behavior?

timc1 commented

Hey @terabyte128! It looks like you may be using disableDocumentLock – if you toggle open kbar you'll notice you can still scroll the background content. I think disabling that will fix your issue.

We actually had this problem when we first released the lib: https://github.com/timc1/kbar/blob/main/src/InternalEvents.tsx#L248

Unfortunately, removing disableDocumentLock didn't appear to fix the issue. I've updated the website to illustrate the behavior with that removed.