-
Notifications
You must be signed in to change notification settings - Fork 84
Fix fileTree dropdown closing when clicking scrollbar #2492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdded a DOM event-prevention routine to keep the file manager's fileTree dropdown from closing when clicking inside action dialogs (e.g., on the scrollbar) and wired that routine into the dialog open/close flows for copy/move actions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
emhttp/plugins/dynamix/Browse.page (2)
603-603: Optional: Consider calling only for actions with fileTree dropdowns.The function is invoked for all actions, but the fileTree dropdown is only opened for copy/move operations (cases 3, 4, 8, 9 where
fileTreeAttachis called). While calling it unconditionally is harmless, you could optimize by placing it inside the relevant case blocks or adding a conditional check.🔎 Example optimization
}); dfm_close_button(); - preventFileTreeClose(); + if ([3, 4, 8, 9].includes(action)) preventFileTreeClose(); if (action == 15) $('.ui-dfm .ui-dialog-buttonset button:eq(1)').prop('disabled',true);
874-874: Optional: Same optimization applies here as indoAction.Similar to line 603, this invocation could be optimized to only run for actions that use fileTree dropdowns (cases 3 and 4 in the
doActionsfunction).
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
emhttp/plugins/dynamix/Browse.page
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-05T19:26:36.587Z
Learnt from: zackspear
Repo: unraid/webgui PR: 2354
File: emhttp/plugins/dynamix/ShareEdit.page:0-0
Timestamp: 2025-09-05T19:26:36.587Z
Learning: In emhttp/plugins/dynamix/ShareEdit.page, the clone-settings div was moved outside the form element and both are wrapped in a div.relative container to prevent event bubbling issues while maintaining proper positioning.
Applied to files:
emhttp/plugins/dynamix/Browse.page
- Stop mousedown event propagation in .ui-dfm dialogs - Use namespaced event (.dfmFileTree) for clean removal - Cleanup automatically via jQuery UI Dialog close callback Fixes unraid#2487
96b9351 to
b6f3080
Compare
Prevent fileTree dropdown from closing when clicking inside the file manager dialog by stopping mousedown event propagation. This fixes the issue where clicking the scrollbar would inadvertently close the target folder selection dropdown.
Solution: Added preventFileTreeClose() function that prevents mousedown events inside .ui-dfm dialogs from bubbling to the document-level handler that closes the fileTree dropdown.
Fixes #2487
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.