Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detached tooltip #3677

Merged
merged 4 commits into from Mar 31, 2021
Merged

Conversation

sowasred2012
Copy link
Contributor

@sowasred2012 sowasred2012 commented Mar 30, 2021

Done

Added a detached tooltip example

Fixes https://github.com/canonical-web-and-design/vanilla-squad/issues/1000

QA

Check if PR is ready for release

If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 馃巵, Breaking Change 馃挘, Bug 馃悰, Documentation 馃摑, Maintenance 馃敤.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention:
    • if CSS class names are not changed it can be bugfix relesase (x.x.X)
    • if CSS class names are changed/added/removed it should be minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) should be listed on the component status page.
  • Documentation side navigation should be updated with the relevant labels.

@sowasred2012 sowasred2012 added the Feature 馃巵 New feature or request label Mar 30, 2021
@webteam-app
Copy link

Demo starting at https://vanilla-framework-3677.demos.haus

@sowasred2012 sowasred2012 marked this pull request as ready for review March 31, 2021 11:01
@sowasred2012 sowasred2012 changed the title WIP detached tooltip Detached tooltip Mar 31, 2021
trigger.addEventListener('mouseenter', function () {
// remove this class on mouseenter,
// rather than unnecessarily on mousemove
tooltip.classList.remove('u-hide');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory tooltip may show up in unexpected place if mouseenter is triggered, but mousemove is not.
Not sure if it may happen, but showing and positioning should happen together.
I think moving removing the hide class name to mousemove handler should work. Or on mouseenter it should also be positioned correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃憤 moved the setting of x and y coords to a separate function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants