-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 : 7223 Clicking Outside Fields domain link email phone Close Them #7804
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 pull request addresses an issue where clicking outside certain fields (domain, links, email, phone) did not close them as expected. The main change focuses on improving the click-outside behavior in the MultiItemFieldInput component.
- Added
handleDropdownCloseOutside
function inMultiItemFieldInput.tsx
to handle click-outside events - Modified
useListenClickOutside
hook usage to incorporate the new click-outside handler - Implemented
event.stopImmediatePropagation()
to prevent unintended event bubbling - Ensured consistency with standard behavior of other fields for improved user experience
1 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
const handleDropdownCloseOutside = (event: MouseEvent | TouchEvent) => { | ||
onCancel?.(); | ||
event.stopImmediatePropagation(); | ||
}; |
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: Consider adding a check if onCancel exists before calling it
useListenClickOutside({ | ||
refs: [containerRef], | ||
callback: handleDropdownClose, | ||
callback: handleDropdownCloseOutside, | ||
}); | ||
|
||
useScopedHotkeys(Key.Escape, handleDropdownClose, hotkeyScope); |
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: Consider moving this line after the state declarations for better organization
@Bonapara could you please review this request?? |
LGTM from a product point of view! Thanks @prathameshpatil5181. Over to the tech team for their review. |
/award 100 |
Awarding prathameshpatil5181: 100 points 🕹️ Well done! Check out your new contribution on oss.gg/prathameshpatil5181 |
@charlesBochet @Bonapara I'll review it as this behavior can be tricky and can easily cause regression. |
fixes #7223
https://github.com/user-attachments/assets/1150e96f-4fb5-40ba-ac17-89d8b2ab16e7