I'm trying to display the sub <ul>
list on the first navigation item when hovering over it:
https://i.sstatic.net/KNqcx.png
Everything is working fine except sometimes (it's inconsistent) when you are between the padding of the first line in the <ul>
item and the sub <ul>
item, the secondary <ul>
will disappear:
https://i.sstatic.net/DhXPT.gif
How can I ensure the secondary navigation list stays open while navigating from the dropdown to the item list?
<ul class="w-full">
<li class="dropdown inline px-4 text-purple-500 hover:text-purple-700 cursor-pointer font-bold text-base uppercase tracking-wide">
<a>Dropdown</a>
<div class="dropdown-menu absolute hidden h-auto flex pt-4">
<ul class="block w-full bg-white shadow px-12 py-8">
<li class="py-1"><a class="block text-purple-500 font-bold text-base uppercase hover:text-purple-700 cursor-pointer">Item</a></li>
<li class="py-1"><a class="block text-purple-500 font-bold text-base uppercase hover:text-purple-700 cursor-pointer">Item 2</a></li>
<li class="py-1"><a class="block text-purple-500 font-bold text-base uppercase hover:text-purple-700 cursor-pointer">Item 3</a></li>
<li class="py-1"><a class="block text-purple-500 font-bold text-base uppercase hover:text-purple-700 cursor-pointer">Item 4</a></li>
<li class="py-1"><a class="block text-purple-500 font-bold text-base uppercase hover:text-purple-700 cursor-pointer">Item 5</a></li>
</ul>
</div>
</li>
<li class="inline px-4 text-purple-500 hover:text-purple-700 cursor-pointer font-bold text-base uppercase tracking-wide"><a>Non-Dropdown</a></li>
<li class="inline px-4 text-purple-500 hover:text-purple-700 cursor-pointer font-bold text-base uppercase tracking-wide"><a>Non-Dropdown</a></li>
<li class="inline px-4 text-purple-500 hover:text-purple-700 cursor-pointer font-bold text-base uppercase tracking-wide lg:pr-8"><a>Non-Dropdown</a></li>
</ul>
.dropdown:hover .dropdown-menu {
display: block;
}