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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: popup doesn't close after fastest hover over target element #44

Open
dail45 opened this issue Jan 17, 2025 · 2 comments
Open

bug: popup doesn't close after fastest hover over target element #44

dail45 opened this issue Jan 17, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@dail45
Copy link

dail45 commented Jan 17, 2025

What version of FlyonUI are you using?

1.3.0

Which browsers are you seeing the problem on?

All browsers

Reproduction URL

https://flyonui.com/docs/overlays/tooltip/

Describe your issue

Image
If you quickly swipe the tooltip activation element, the hint will appear and will not disappear (very easy to get with the console open, but that doesn't mean it's impossible without it)

Code:
src/js/plugins/tooltip/index.ts:166

private _show() {
    this.content.classList.remove('hidden')
    if (this.scope === 'window') this.content.classList.add('show')

    if (this.preventPopper === 'false') {
      this.popperInstance.setOptions(options => ({
        ...options,
        modifiers: [
          ...options.modifiers,
          {
            name: 'eventListeners',
            enabled: true
          }
        ]
      }))

      this.popperInstance.update()
    }

    setTimeout(() => { // Why needs this setTimeout? #185
      this.el.classList.add('show')

      this.fireEvent('show', this.el)
      dispatch('show.tooltip', this.el, this.el)
    })
  }

public hide() {
    this.el.classList.remove('show') // where setTimeout if it needs?
...

Problem timeline:

  1. invoke _show
  2. setTimeout
  3. hide (remove class "show" but it not exists)
  4. setTimeout from step 2 is running and add class "show"
  5. I'm writting issue

Possible solution:
remove setTimeout from 185 line.

Copy link

Hi @dail45

Thank you for your support in helping us improve FlyonUI!

We’ve received your submission and will respond within few business days. Our team handles issues one at a time, and we’ll be reviewing yours as soon as possible.

In the meantime, any additional details or a reproducible example would be greatly appreciated and will help us resolve the issue more efficiently.

Thank you for your patience and understanding!

@yagnikvamja yagnikvamja added the bug Something isn't working label Jan 20, 2025
@yagnikvamja
Copy link
Member

Hello @dail45 ,

Thank you for bringing this issue to our attention and for providing a detailed explanation along with a possible solution. We truly value your effort and input.

We acknowledge that this appears to be a rare but valid scenario, and our team is actively investigating it to ensure we find the most effective and comprehensive resolution. While your suggested solution works well for tooltips, we want to thoroughly evaluate its compatibility across all variants before implementing it universally.

We sincerely appreciate your patience and understanding as we work towards an accurate and robust fix. Rest assured, we will keep you informed as soon as we have a finalized solution.

Thank you again for your support.

~Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants