AdminLTE icon indicating copy to clipboard operation
AdminLTE copied to clipboard

[BUG] Submenu blinks on opening if nav-collapse-hide-child is set

Open th0masj0 opened this issue 3 years ago • 2 comments

Describe the bug In case the nav-sidebar element of main-sidebar which has nav-collapse-hide-child set the menu will shortly blink after opening. See video.

To Reproduce Steps to reproduce the behavior:

  1. Set nav-collapse-hide-child on nav-sidebar
  2. Click on nav-item with childs
  3. See blinking

Expected behavior Normal opening with animation like without nav-collapse-hide-child..

Screenshots adminlte-bug

Environment (please complete the following information):

  • AdminLTE Version: v3.2.0
  • Operating System: Windows 11
  • Browser (Version): Chrome (Latest)

th0masj0 avatar Apr 27 '23 10:04 th0masj0

Hey,

I've analyzed the problem a little bit further. The raison for this is a wrong CSS. The current (bad) workflow is:

  1. Click on toggle sets per JS on parent listitem (nav-item) the css "menu-is-opening". Also in JS the slideDown with animationSpeed (0.3s) will be called.
  2. After slide down animation the css "menu-open" is set additional to menu-is-opening. This triggers css animation fadeIn for another 0.3s.

A fix needs changing this css from .nav-collapse-hide-child .men-open ... to .... .menu-open:not(.menu-is-opening) ... Then fadeIn animation will not be done with slidedown animation.

.nav-collapse-hide-child .menu-open:not(.menu-is-opening) > .nav-treeview {
  max-height: min-content;
  animation-name: fadeIn;
  animation-duration: 0.3s;
  animation-fill-mode: both;
}

th0masj0 avatar May 02 '23 17:05 th0masj0

Closing as part of issue triage. This issue is from v3/early v4 development and is either resolved, outdated, or outside the current scope. If the issue persists with v4.0.0-rc7, please open a new issue.

puikinsh avatar Mar 10 '26 10:03 puikinsh