taiga-ui icon indicating copy to clipboard operation
taiga-ui copied to clipboard

Dropdown display delay for "tuiDropdownHover" Directive 🚀

Open OlecsandrKirpa opened this issue 2 years ago • 1 comments

Which @taiga-ui/* package(s) are relevant/releated to the feature request?

kit

Description

Hello, it would be really great if - when using tui-hosted-dropdown - would be possible to delay the opening of the dropdown on hover. I'm using tuiDropdownHover, but the dropdown opens immediatly, it would be cool to delay the opening of the dropdown. Maybe something like

  <tui-hosted-dropdown tuiDropdownHover tuiDropdownHoverDelay="1000" >
    <!-- ... -->
  </tui-hosted-dropdown>

I would like to suggest a implementation

export class TuiDropdownHoverDirective {
  // ... Currently present logic ...

  @Input("tuiDropdownHoverDelay") delay: number = 0;

  @HostListener(`mouseenter`)
  onMouseEnter(): void {
    setTimeout(() => {
      // ...current logic
    }, this.delay);
  }
}

Thank you! Have a good week!

OlecsandrKirpa avatar Aug 05 '22 13:08 OlecsandrKirpa

I am refactoring dropdowns for 3.0, it should be fairly easy to do once I'm done :)

waterplea avatar Aug 09 '22 06:08 waterplea

You can do this with [tuiDropdownShowDelay] / [tuiDropdownHideDelay] now in 3.0 (don't forget brackets so it's an actual number, not a string).

waterplea avatar Sep 29 '22 15:09 waterplea