Skip to content

Tab bar body doesn't handle scroll event. Only scrollbar does #285

@fricze

Description

@fricze

Describe the bug
When you add more tabs to particular node tab bar becomes scrollable. Unfortunately tab bar body doesn't handle scroll event. Only scrollbar does. Looking at the code, it seems to be a bug. There's a scroll change handled when tab bar response is hovered, but it seems that particular tabs cover the tab bar response and do not allow event to bubble as expected.

Relevant code is lines 1163 - 1165, from file src/widgets/dock_area/show/leaf.rs

if tabbar_response.hovered() {
    leaf.scroll += ui.input(|i| i.smooth_scroll_delta.y + i.smooth_scroll_delta.x);
}

To Reproduce
Steps to reproduce the behavior:

  1. Open "Tab add" example
  2. Add a bunch of new tabs so they overflow available space and scrollbar appears
  3. Place pointer on a tab, not scrollbar, and try to scroll with mouse or touchpad
  4. See that tab bar doesn't scroll

Expected behavior
Tab bar should scroll when pointer is placed in tab bar body and user scrolls with mouse or touchpad

Screenshots
Scroll works only when pointer is placed above scrollbar
https://github.com/user-attachments/assets/12f24ad7-b6a1-4cbc-91a5-40fb5ab2734e

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions