taiga-ui
taiga-ui copied to clipboard
Dropdown display delay for "tuiDropdownHover" Directive 🚀
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!
I am refactoring dropdowns for 3.0, it should be fairly easy to do once I'm done :)
You can do this with [tuiDropdownShowDelay]
/ [tuiDropdownHideDelay]
now in 3.0 (don't forget brackets so it's an actual number, not a string).