Skip to content

Weird position behaviour in dynamic routes #1090

Discussion options

You must be logged in to vote

The tooltip is definitely losing the references to the anchors when the route changes, so the position defaults to 0,0 on the screen.

One way that has worked in other situations is to force the tooltip to re-render when the route changes, so the tooltip can get the references to the newly rendered components. Assuming you're using react-router-dom or something similar for your routes, try using the key prop. This should force a re-render on route change.

<Tooltip key={location.pathname} {...} />

As for the tooltip overflowing, I believe it's easier to fix the other stuff first, and then get to that.

Replies: 2 comments 19 replies

Comment options

You must be logged in to vote
11 replies
@ricardo-fnd
Comment options

@gabrieljablonski
Comment options

@ricardo-fnd
Comment options

@gabrieljablonski
Comment options

Answer selected by ricardo-fnd
@ricardo-fnd
Comment options

@gabrieljablonski
Comment options

@ricardo-fnd
Comment options

@gabrieljablonski
Comment options

Comment options

You must be logged in to vote
8 replies
@gabrieljablonski
Comment options

@ricardo-fnd
Comment options

@gabrieljablonski
Comment options

@ricardo-fnd
Comment options

@gabrieljablonski
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants