How to set delay on signal's setter
Hello! I'm trying to set a delay between mouseover and then menu opening. The menu is opened depending on signal state
<li>on:mouseover={ setDropdownVisible('block') }</li>
Once dropdownVisible() has set I set style display block on the menu
I try to create the delay like this :
<li>on:mouseover={ setTimeout(setDropdownVisible('block'), 1000) }</li>
and it doesn't work. I guess this is a wrong way but what is right one and why?
5 Replies
GitHub
solid-primitives/packages/scheduled at main · solidjs-community/sol...
A library of high-quality primitives that extend SolidJS reactivity. - solid-primitives/packages/scheduled at main · solidjs-community/solid-primitives
also, <li onMouseOver={() => setDropDownVisible('block')}>
please write correct JSX.
Why can't I just pass the setter withoyt wrapping it in a function&
try this. maybe incorrect syntax was the issue
Yes! It works, thank you!