Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Tooltip only works with elements that can function when surrounded by a div #181

Open
atsepkov opened this issue Mar 18, 2021 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@atsepkov
Copy link

Tooltip component wraps the element in a div, which is not the correct approach. Typically in other UI libraries, tooltip element is implemented as an absolutely positioned div that can be re-rendered at the location of the element to which the tooltip is assigned, rather than generating a physical div around the element. Current approach breaks when attempting to create a tooltip for elements that are part of a larger whole, for example:

  • any element belonging to a table (th, tr, td)
  • list entries (li, dt, dd)
  • select entries (option)
  • other elements I probably forgot about

I recommend a singleton tooltip element that repositions itself via event.target coordinates.

@Florian-Schoenherr
Copy link
Collaborator

Florian-Schoenherr commented Mar 18, 2021

It does use an absolutely positioned span, don't know why it wraps the element at all.

@Florian-Schoenherr Florian-Schoenherr added bug Something isn't working enhancement New feature or request labels Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants