-
Notifications
You must be signed in to change notification settings - Fork 463
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
Fix: the "open new vault" button won't create a separate window #506
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR fixes the "open new vault" button functionality and improves modal closing behavior across multiple components.
- Fixed modal closing behavior in
/src/components/Common/Modal.tsx
by adding proper backdrop click detection and preventing event propagation - Added empty pointer event handlers to buttons in multiple components to prevent event propagation issues
- Modified
/src/components/Sidebars/IconsSidebar.tsx
to show an in-app modal instead of opening a new window - Added
onClose
prop toInitialSetupSinglePage
component for better modal management - Implemented proper state management for the vault setup modal with conditional rendering
💡 (3/5) Reply to the bot's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!
10 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
@@ -20,15 +20,17 @@ const ReorModal: React.FC<ModalProps> = ({ | |||
|
|||
useEffect(() => { | |||
const handleOffClick = (event: MouseEvent) => { | |||
if (modalRef.current && !modalRef.current.contains(event.target as Node)) { | |||
const isBackdropClick = event.target === document.querySelector(`.${tailwindStylesOnBackground}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Check if tailwindStylesOnBackground is undefined before using it in the querySelector.
const isBackdropClick = event.target === document.querySelector(`.${tailwindStylesOnBackground}`) | |
const isBackdropClick = tailwindStylesOnBackground ? event.target === document.querySelector(`.${tailwindStylesOnBackground}`) : event.target === event.currentTarget |
onPointerEnterCapture={() => {}} | ||
onPointerLeaveCapture={() => {}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Empty event handlers added here but not used. Consider removing if not needed or document why they're required for the Material Tailwind Button component.
onPointerEnterCapture={() => {}} | |
onPointerLeaveCapture={() => {}} |
Mostly looks good! One thing though is maybe downgrade |
Before:
Screen.Recording.2025-02-26.at.13.25.54.mov
After:
after.mov
Other fixes: