fix(web): close model selector on outside click#974
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | d4aad57 | May 19 2026, 09:17 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | d4aad57 | Commit Preview URL Branch Preview URL |
May 19 2026, 09:18 PM |
MaheshtheDev
approved these changes
May 19, 2026
|
Claude finished @MaheshtheDev's task in 50s —— View job Code Review Complete
Overview: Replaces a fragile fixed-position backdrop with a document-level mousedown listener to close the model selector dropdown on outside clicks. Issues found: None — this looks good to ship. The implementation follows React best practices:
Score: 10/10 Clean, focused fix that correctly addresses the CSS stacking context issue without introducing new bugs or complexity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Clicking outside the model selector dropdown did not close it. The previous implementation used a
<button className="fixed inset-0 z-40">backdrop overlay, butposition: fixedis broken when an ancestor hasbackdrop-blur,transform,filter, orwill-change— it becomes relative to that ancestor instead of the viewport. The chat container usesbackdrop-blur-md, which caused the backdrop button to not cover the full page.Fix
Replaced the fragile fixed-position backdrop with a
useEffectthat attaches amousedownlistener ondocumentwhen the dropdown is open. It checks if the click target is outside the component ref and closes the dropdown if so. The listener is cleaned up when the dropdown closes.Testing
Logic verified by code review — the
document.addEventListener('mousedown', ...)approach is not affected by CSS stacking context issues since it operates at the DOM event level, not via z-index/positioning.Session Details
(aside)to your comment to have me ignore it.