[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Correct scroll behavior for dropdowns on SmartMenus

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6925f3cc71f26_2a171af60926b4@gitlab-sidekiq-low-urgency-cpu-bound-v2-7cc5cbf57-ljsqk.mail>

luci pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
618d2dff by Yves Ngalamulume at 2025-11-25T18:13:05+00:00
[FIX] Correct scroll behavior for dropdowns on SmartMenus
---
* [FIX] Ensure dropdown menus display correctly below fixed-top navbar

* [REF] Remove obsolete imports and CSS code for cleaner code

* [FIX] Refactor dropdown menu positioning logic and styles for improved usability

* [FIX] Improve dropdown menu click handling for better overflow management

See merge request tikiwiki/tiki!8813

- - - - -


2 changed files:

- src/js/jquery-tiki/tiki-menu.js
- themes/base_files/scss/_tiki-menus.scss


Changes:

=====================================
src/js/jquery-tiki/tiki-menu.js
=====================================
@@ -34,11 +34,11 @@ $(function () {
         const rect = this.getBoundingClientRect();
 
         // Determine vertical and horizontal position
-        const vertical = rect.top < window.innerHeight / 2 ? "top" : "bottom";
-        const horizontal = rect.left < window.innerWidth / 2 ? "end" : "start";
+        const vertical = rect.top < window.innerHeight / 2 ? "top-t" : "bottom-b";
+        const horizontal = rect.left < window.innerWidth / 2 ? "end-l" : "start-r";
 
         // Remove existing position classes
-        $menu.removeClass("dropdown-menu-top dropdown-menu-bottom dropdown-menu-end dropdown-menu-start");
+        $menu.removeClass("dropdown-menu-top-t dropdown-menu-bottom-b dropdown-menu-end-l dropdown-menu-start-r");
 
         if (vertical && horizontal) {
             // Add new position classes


=====================================
themes/base_files/scss/_tiki-menus.scss
=====================================
@@ -160,18 +160,22 @@
     bottom: 100% !important;
     margin-bottom: .5rem;
     margin-top: 0 !important;
-    max-height: 65vh;
     overflow-y: auto;
     overflow-x: hidden;
 }
 
-.dropdown-menu-top,
-.dropdown-menu-end,
-.dropdown-menu-start {
+.dropdown-menu-top-t,
+.dropdown-menu-end-l,
+.dropdown-menu-start-r {
   top: 100%;
   bottom: auto;
   max-height: 40vh;
   overflow-y: auto;
   overflow-x: hidden;
-  z-index: 3000;
+  z-index: 2000 !important;
+}
+
+.dropdown-menu-bottom-b {
+    max-height: 65vh;
+    z-index: 3000;
 }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/618d2dff0ef379d6c28ca026b6f2217f4f2efba4

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/618d2dff0ef379d6c28ca026b6f2217f4f2efba4
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.