Comments (7)
Fixed on official release [email protected]
from react-tooltip.
Is this something that's very noticeable from a user perspective? My guess is that's happening only for a few frames, so barely visible. If that's not the case, and it's in fact noticeable, please provide a reproducible sample, since I've been unable to do reproduce it myself.
In case my assessment is correct, this is something we can't realistically fix right now, since it's due to a design limitation on how the tooltip handles its internal state, and it doesn't impact user experience. As you've noticed from the logs, there are basically 2 render cycles here: first the active anchor changes, and then the other internal states (such as the content) are updated according to it on the next cycle.
I'll leave this open for now, but it should be noted it is closely related to #1010, since the issue there (position and open state synchronization) is also due to how the internal state is handled.
We plan to address this design problem in the near future with v6, so hopefully this will also be fixed alongside #1010.
Thanks for reporting, and please let us know if you've actually come up with a situation where this issue is noticeable for the user.
from react-tooltip.
yes, you're right. the error may be related to this topic.
This bug occurs for 1-2 frames and is only noticeable if the height of tooltips for elements is different. in my example it is the left and middle element. I made a simple repository that you can use to reproduce this bug. I hope it will be useful to you. node js version 18.17.1.
a screenshot of how the user sees it
An interesting detail. when I customized the example, I first used react version 17.0.2. it doesn't show this bug visually. I created a separate branch to reproduce it.
thank you for your reply
from react-tooltip.
Yep, definitely noticeable when the height changes. This is something we'll keep in mind when working on the design changes for V6.
Though there's something interesting I suggest you try. Does it still happen with the browser dev tools closed? On my computer, with the dev tools closed, I haven't been able to reproduce the bug visually, but if happens every time with it open.
My guess is that the dev tools introduce some performance overhead, so it ends up "lagging" the tooltip a bit. It's worth testing if maybe your application won't be affected by this on a production build.
Still, this is definitely something we're aiming to fix.
from react-tooltip.
It's true, the bug is not observed visually with the closed dev tools. On a production build with open dev tools the error is also observed.
Very strange behavior...
from react-tooltip.
If you log the props, you can see that activeAnchor
get setState'd one render before content
does, so it really does change before. If you use data-tooltip-content
, you can keep them in sync by just not reading content
and reading the dataset value from the anchor itself, when using render
:
<Tooltip
render={({ activeAnchor }) => activeAnchor && <span>{activeAnchor?.dataset['tooltipContent']}</span>}
....
/>`
from react-tooltip.
unfortunately, when using the developer tools, the tooltip height bug is noticeable even when using your variant
from react-tooltip.
Related Issues (20)
- [BUG] When using default rt-transition-show-delay, tooltip stays in DOM after visibly closing HOT 13
- [BUG] Infinite rerender loop when tooltip is open for an anchor that is inside a scrolled overflow HOT 2
- [BUG] "mousemove" is not working on drag but "pointermove" event will work HOT 9
- [BUG] Strings are not escaped properly HOT 2
- [BUG] when i zoom out or in the big screen resolutions the tooltip is not in right place HOT 3
- Can't import the named export 'arrow' from non EcmaScript module (only default export is available) HOT 7
- [BUG] openEvents does not work with "click" HOT 4
- Is is possible to export default middlewares? HOT 1
- [BUG] Testing react-tooltip with modal result to a failed HOT 1
- [BUG] Tooltip shows briefly when using delayShow and moving to directly adjacent element HOT 3
- [FEAT REQ] Render tooltips inside portal HOT 4
- [BUG] CSP breaks, styles are injected even after disableStyleInjection is used HOT 2
- The component doesn't show the tooltip when there is a single quote " ' " in the data-tooltip-id and the id passed on the Tooltip component. HOT 2
- Safari mobile browser gets the error e.getAttributeNames HOT 2
- [BUG] : When ' (single quote) is used any where in the text, the tooltip doesn't open HOT 4
- I have set opacity to 1 but I can still see though HOT 3
- [BUG] HOT 2
- [BUG] anchor element does not close the tooltip on click HOT 3
- [BUG] #1042 Regression from 5.26.0 → 5.26.1 HOT 1
- Tooltip is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-tooltip.