Code Monkey home page Code Monkey logo

Comments (3)

claviska avatar claviska commented on September 27, 2024 6

I've opened a PR both of these issues: #1749

The solution to the hover issue is probably best described with a GIF. Since we abstract positioning with <sl-popup>, I've added <sl-popup hover-bridge> so other components can benefit from this in the future.

The GIF shows the "safe trapezoids" in orange, but they're invisible normally. Hovering over it will persist the tooltip unless the user presses Esc.

CleanShot 2023-11-29 at 15 36 45

from shoelace.

claviska avatar claviska commented on September 27, 2024 1

I fixed the Esc issue in 7364fa1. Regarding the other issue:

It should be possible to move the mouse pointer over the tooltip content without the tooltip disappearing. At the moment, the Tooltip closes as soon as the pointer is moved away from the triggering element.

I see from this document that they call out native title tooltips.

Examples of additional content controlled by the user agent include browser tooltips created through use of the HTML title attribute [[HTML]].

Interestingly, neither Chrome, Firefox, nor Safari follow this.

https://codepen.io/claviska/pen/QWYVmzW

Nevertheless, I'll see if I can come up with a solution to account for this requirement.

from shoelace.

CetinSert avatar CetinSert commented on September 27, 2024

Esc key might need a global KeyboardEvent handler.

Not sure if ...

  • ... Shoelace is already using any global handlers
  • ... Shoelace is supposed to listen globally for Esc
  • ... I have seen any other library with Esc support

Perhaps this could be handled in the docs with a simple example.

If <sl-tooltip> dispatches bubbling sl-show/sl-after-show events,

  • users can be told to listen for them
    • confirm event.target, add an AbortSignal-cancelable KeyboardEvent listener (global or scoped)
    • remove the listener by aborting the above signal on one of the following cases:
      • sl-hide from the <sl-tooltip>
      • KeyboardEvent with the Esc key

from shoelace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.