-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
When the tooltip is shown and for any reasons the target goes away from the DOM, the tooltip won't go away and it will be frozen on the screen. So, I added and binded DOMNodeRemovedFromDocument event (just 2 lines of code). #259
Conversation
…d and the tooltip is still visible
Well, the problem indeed exists. For everyone who wants to reproduce the problem: However, it seems that |
Hello again, @antoniogiordano! Could you remove e79f781f4eba1ed50a02de13bbfc635bcd113aa4 from this PR, please? Also, I think this fix is not enough. I think we should check if the target of |
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.
After cleanup and fixing the issue described here this PR can be merged, I guess.
Hi Huumanoid! I removed the commit, now you can merge it. |
I just added a check as you suggested, with your example it seems to work :-) |
I've just checked: it's awesome! Thank you a lot! @wwayne, please, take a look! |
I removed the option, check if it is fine ;-) |
Hey @antoniogiordano, please, check is this thing works in firefox? |
I'm afraid but it seems like the problem is more difficult than we expected: npm install github:huumanoid/react-tooltip#fix-track-removal-firefox-dist Please, check it. |
Hi huumanoid, sure, I will give a look to MutationObserver to fix for firefox as well ASAP! |
I'm sorry but it's already done
Thank you for your ideas and efforts, I hope it's over with this bug! |
Hi , @huumanoid I was actually working on some performance fixes in our application where we use React Tool Tip extensively, and I saw bunch of micro task being fired coming from this exact code that was merged here. I understand the use case. But is there anyway we can batch it under one Mutation Observer in anyway. Our application does have a few ReactToolTip enabled at same time , and by the looks of the code from what I understand the MutationObserver and it's function callback is unique to each ToolTip instances (correct me If did get that wrong , it seems the code is using decorators as way of merging the objects after creation). I was thinking if somehow we can combine them i.e batch them, the micro task duration and number of fires can be controlled. Basically have one MutationObserver do the task of listening and then have every new instance of React tooltip hook onto the observer , since every tool tip instance is anyway listening to document modification only. PS: The reason I am convinced about batching behaviour is because the multiple micro task that are fired have a Let me know if this makes sense would like to take up the PR for this if we are on same page 😅 |
…d and the tooltip is still visible