-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tooltip: registering show/hide events twice on each target #3701
Labels
React 18/19
Issue or pull request is *only* related to React 18/19
Type: Bug
Issue contains a defect related to a specific component.
Milestone
Comments
melloware
added
the
Type: Bug
Issue contains a defect related to a specific component.
label
Nov 24, 2022
github-actions
bot
added
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Nov 24, 2022
melloware
removed
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Nov 24, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Nov 24, 2022
This was referenced Nov 24, 2022
melloware
added a commit
that referenced
this issue
Jan 6, 2023
melloware
added a commit
that referenced
this issue
Jan 7, 2023
github-actions
bot
added
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Jan 8, 2023
melloware
removed
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Jan 9, 2023
melloware
added a commit
to melloware/primereact
that referenced
this issue
Apr 27, 2023
This is fixed when I fixed: https://github.com/primefaces/primereact/pull/4364/files#diff-c2ff596ea86904612fb6c1def69d13221fa5916ade03a45d9740e2d38bdc72a3 it was a React 18 Strict mode double mounting issue. |
melloware
added
the
React 18/19
Issue or pull request is *only* related to React 18/19
label
May 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
React 18/19
Issue or pull request is *only* related to React 18/19
Type: Bug
Issue contains a defect related to a specific component.
Describe the bug
Tooltip is registering 2 show and 2 hide events on every tooltip target.
By switching from Mount Effect + Update Effect to just a single React.useEffect reduces the amount of registered listeners. Show and Hide events were being registered twice on all components and this is due to the fact the functions being added are anonymous.
See MDN: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
If you go to the current showcase and Inspect the button with a tooltip registered you will see this...
Reproducer
https://primefaces.org/primereact/tooltip/
PrimeReact version
8.7.2
React version
17.x
Language
ALL
Build / Runtime
Next.js
Browser(s)
ALL
Steps to reproduce the behavior
mouseenter
andmouseleave
are registered twiceExpected behavior
Only 1 show and hide event registered
The text was updated successfully, but these errors were encountered: