estevanmaito / windmill-dashboard

📊 A multi theme, completely accessible, ready for production dashboard.
https://windmillui.com/dashboard-html
MIT License
2.85k stars 475 forks source link

Multiple <li> tag SideBar Multitree Error #10

Closed niilante closed 3 years ago

niilante commented 3 years ago

Created two multiple side bar li tags and I realized that when I click on any of the links in the browser both trees open up and the close up when I click on any also.

Using the HTML version

estevanmaito commented 3 years ago

Without seeing the code, I can only imagine that you didn't change the following values, and just duplicated the lists, hence they are answering for the same events:

The button that open the list executes togglePagesMenu:

<button
  class="inline-flex items-center justify-between w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
  @click="togglePagesMenu"
  aria-haspopup="true"
>

This sublist depends on isPagesMenuOpen:

<template x-if="isPagesMenuOpen">

The method executed by button and the property above are located here: https://github.com/estevanmaito/windmill-dashboard/blob/master/public/assets/js/init-alpine.js

If you're creating another list with sublist, you should changes those values.