Skip to content

feat: support for multiple mouse button click in side bar #1305#1307

Merged
pedro-martins-brisa merged 1 commit intomainfrom
1305-support-for-multiple-mouse-buttons-middle-click-in-sidebar-navigation
Dec 22, 2025
Merged

feat: support for multiple mouse button click in side bar #1305#1307
pedro-martins-brisa merged 1 commit intomainfrom
1305-support-for-multiple-mouse-buttons-middle-click-in-sidebar-navigation

Conversation

@pedro-martins-brisa
Copy link
Member

@pedro-martins-brisa pedro-martins-brisa commented Dec 18, 2025

feat #1305

Description

This Pull Request introduces advanced navigation support for the Sidebar, allowing users to use the mouse middle button (scroll click) to open links in new tabs.

Why is this change necessary? Previously, the component relied solely on the standard (click) event, which is limited to the left mouse button. In productivity-focused workflows, users often need to open multiple sidebar modules in new tabs without losing their current context.

Proposed Changes

Sidebar Item Component

  • Replaced the (click) event binding in the template with @HostListener('mousedown') to reliably capture all button inputs in Angular 8 environments.
  • Implemented logic to ignore the right mouse button, preventing accidental navigation triggers when opening context menus.
  • Added event.preventDefault() and event.stopPropagation() specifically for the middle click to disable the browser's native "auto-scroll" feature.
  • Protected the selected property: the item only updates its visual state if the click is performed with the left mouse button.

Sidebar Component & Group

  • Updated itemSelected and groupSelected logic to respect the specific mouse button pressed.
  • Ensured that the sidebar does not trigger toggleSidebarVisibility() (auto-closing) when an auxiliary button is detected.

Utilities & Global

  • Created the MOUSE_BUTTONS constant object (LEFT: 0, MIDDLE: 1, RIGHT: 2) for standardization.

Compliance

  • I have verified that this change complies with our code and contribution policies.
  • I have verified that this change does not cause regressions and does not affect other parts of the code.

@pedro-martins-brisa pedro-martins-brisa merged commit d4efb08 into main Dec 22, 2025
4 checks passed
@pedro-martins-brisa pedro-martins-brisa deleted the 1305-support-for-multiple-mouse-buttons-middle-click-in-sidebar-navigation branch December 22, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for multiple mouse buttons (Middle Click) in Sidebar navigation.

3 participants