-
Notifications
You must be signed in to change notification settings - Fork 30
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 kebab menu close when we click outside the kebab. #1595
base: master
Are you sure you want to change the base?
Fix the kebab menu close when we click outside the kebab. #1595
Conversation
8bfe4dc
to
ef4adc5
Compare
LGTM. @SanjalKatiyar for tagging. |
1 similar comment
LGTM. @SanjalKatiyar for tagging. |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bipuladh, TimothyAsirJeyasing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm cancel |
packages/shared/src/kebab/kebab.tsx
Outdated
|
||
const { resourceModel, resource } = extraProps; | ||
// Use the custom hook to detect clicks outside the Kebab menu | ||
useClickOutside(dropdownRef, () => setOpen(false)); |
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.
u are passing callback () => setOpen(false)
to dep list of useEffect inside useClickOutside
hook, but ref of this callback is changing on each re-render.
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.
wrap it around useCallback
plz...
@TimothyAsirJeyasing plz add corresponding Jira BZ link to this PR... |
@TimothyAsirJeyasing please rebase & solve conflicts. |
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2308314 Jira: https://issues.redhat.com/browse/DFBUGS-351 Signed-off-by: Timothy Asir Jeyasingh <[email protected]>
ef4adc5
to
54ce4b0
Compare
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2308314
https://issues.redhat.com/browse/DFBUGS-351