Skip to content

ScrollArea (and all scoll-able widgets) scroll-able even when not enabled #4341

@thmxv

Description

@thmxv

Describe the bug
I try to disable the whole main window when a modal window is visible on top but of the disabled widget on the main window, the ScrollArea widgets are still scroll-able.

This issues affects all the scroll-able widgets (egui-extras::TableBody for example) not only the ScrollArea.

In 0.26 the issue was impacting all the drag-able widgets also but this is fixed in 0.27 and still is in git master.

To Reproduce

fn main() {
    let mut main_enabled = false;

    let _ = eframe::run_simple_native(
        "Issue test",
        eframe::NativeOptions::default(),
        move |ctx, _frame| {
            egui::CentralPanel::default().show(ctx, |ui| {
                ui.checkbox(&mut main_enabled, "Enabled");
                ui.separator();
                ui.add_enabled_ui(main_enabled, |ui| {
                    egui::ScrollArea::vertical().show(ui, |ui| {
                        for _ in 0..100 {
                            ui.label("some text");
                        }
                    });
                });
            });
        },
    );
}

Expected behavior
I expect the scroll-able widgets to not be able to be interacted with at all when disabled.

Desktop (please complete the following information):

  • OS: Linux 6.6.25 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions