-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: date input click outside #9676
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
Improved click-outside detection for the DateInput component by implementing pixel-based comparison and adding dropdown focus ID validation.
- Added
ClickOutsideMode.comparePixels
inDateInput.tsx
for more accurate click detection based on pixel coordinates - Implemented dropdown focus ID validation in
useRegisterInputEvents.ts
to prevent unwanted click-outside triggers - Added debug mode and improved logging in
useListenClickOutside.ts
for better troubleshooting - Refactored click detection logic using switch statements for cleaner mode handling
- Added proper dependency tracking for
listenerId
inuseListenClickOutside.ts
3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
...ront/src/modules/object-record/record-field/meta-types/input/hooks/useRegisterInputEvents.ts
Show resolved
Hide resolved
packages/twenty-front/src/modules/ui/utilities/pointer-event/hooks/useListenClickOutside.ts
Show resolved
Hide resolved
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.
LGTM !
See #9486
This PR fixes a latent bug that was caused by the recent dropdown focus id refactor. It was correctly implemented for dropdowns but not for places where we manually open and close dropdown-like components that also uses a useListenClickoutside.
This was the case for table cells and inline cells.