Problem/Motivation

Currently, the tooltip is tightly linked to the entire sidebar script. Although in fact it is a completely independent component, and all it needs is just a few attributes and focus and a CSS hoover. And there is no need to clone the tooltip for it to work.

We see that in the future such a component will appear in the core of the administrative theme:
https://www.drupal.org/project/drupal/issues/3197758

Thus, we must take it out of the general script and styles and keep in mind that it will be used independently. So that later we can easily combine them.

Pros: Obvious simplicity, reusability and independence

Issue fork navigation-3393067

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

finnsky created an issue. See original summary.

finnsky’s picture

Status: Active » Needs review
finnsky’s picture

ckrina’s picture

We see that in the future such a component will appear in the core of the administrative theme: #3197758: Create a new component: Toggletip.

This is not the same component: the one being proposed to core is a Toggletip. The difference is that a tooltip is exposed on Hover (or Focus) while a toggletip is used on Click or Enter.

Cons: Closing the submenu does not work in the current MP

I tried the submenus on Tugboat and seem to work fine: what am I missing?

finnsky’s picture

RE: `This is not the same component: the one being proposed to core is a Toggletip. The difference is that a tooltip is exposed on Hover (or Focus) while a toggletip is used on Click or Enter.`

I think it is related to component flexibility, `data-toggle-on="hover/click"` etc.

Regression fixed. Temporary for now.

finnsky’s picture

- Rebased on current 1.x
- Added resize observer for trigger.
- Added temporary fix to close cloned flyouts

finnsky’s picture

Issue summary: View changes
nod_’s picture

Title: Added tooltip component. » Added tooltip component
nod_’s picture

Status: Needs review » Needs work

Left some comments, not 100% sure about the data-tooltip attribute. the naming is very generic so we might run into problems later, in core we've been prefixing things with drupal, so `data-drupal-tooltip` maybe?

finnsky’s picture

Status: Needs work » Needs review
nod_’s picture

Status: Needs review » Fixed

Great, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.