Skip to content
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

Implemented useListenClickOutside V2 #3507

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Implemented useListenClickOutside V2 #3507

merged 2 commits into from
Jan 17, 2024

Conversation

lucasbordeau
Copy link
Contributor

@lucasbordeau lucasbordeau commented Jan 17, 2024

Closes #3416, closes #3412

  • Created scoped states for useListenClickOutside
  • Created a module hook useClickOutsideListener
  • listenerActivated is a scoped state that can be changed from anywhere
  • isMouseDownInside is now a scoped state that fix various bugs and re-renders.
  • click handlers are now recoil callbacks.

@charlesBochet
Copy link
Member

Discussed with you offline, we should follow the componentId pattern and introduce isClickOutsideListnerActivated stateScopeMap

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -16,6 +16,8 @@ export const MultipleObjectRecordOnClickOutsideEffect = ({

onClickOutside();
},
listenerId: 'multiple-object-record',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

introduce a constant

@charlesBochet charlesBochet merged commit bbfe62d into main Jan 17, 2024
14 checks passed
@charlesBochet charlesBochet deleted the feat/3416 branch January 17, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants