chrisdavies/tlite

window resize results in misplaced tooltip

Closed this issue · 1 comments

Resizing a window can cause the tooltip to move away from its element. See video for example from your home page.

https://www.youtube.com/watch?v=IF85YsMhA4E

perhaps add a document resize listener to remove tooltips?

Yeah. That's a known flaw. I thought I had a note about it in the readme. I originally thought of adjusting the location when resize happens, but that makes tlite too resource intensive.

Removing it is a better option, but there are other scenarios where you might get a resize and the document resize listener wouldn't catch it (e.g. if a parent div resizes due to dynamic content, etc).

I'd originally made the tooltips relative, but that had its own set of issues... Hm.

Well, anyway, I think tlite's main use case is hover tooltips. I think for now, I'll add a readme note that this as a known flaw, with the appropriate workaround being left up to the library consumers.