-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ScrollArea
(and all scoll-able widgets) scroll-able even when not enabled
#4341
Comments
I think you should add '.enable_scrolling(main_enabled)', try that. 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()
.enable_scrolling(main_enabled)
.show(ui, |ui| {
for _ in 0..100 {
ui.label("some text");
}
});
});
});
},
);
} |
This works, for
Anyway, this is low priority and only a weird behavior not a serious bug. So feel free to close if this is the wanted behavior in disabled UI. Also thanks for the help. |
…4457) ## Summary This PR modifies `ScrollArea` and `Plot` to disable their interactions when the UI is disabled. ## Changes - Interaction with `ScrollArea` in `egui` is disabled when the UI is disabled. - Interaction with `Plot` in `egui_plot` is disabled when the UI is disabled. - These changes ensure that `ScrollArea` and `Plot` behave consistently with the rest of the UI, preventing them from responding to user input when the UI is in a disabled state. ## Impact This PR enhances the consistency of `egui`'s UI behavior by ensuring that all elements, including `ScrollArea` and `Plot`, respect the UI's disabled state. This prevents unexpected interactions when the UI is disabled. Closes #4341
…milk#4457) ## Summary This PR modifies `ScrollArea` and `Plot` to disable their interactions when the UI is disabled. ## Changes - Interaction with `ScrollArea` in `egui` is disabled when the UI is disabled. - Interaction with `Plot` in `egui_plot` is disabled when the UI is disabled. - These changes ensure that `ScrollArea` and `Plot` behave consistently with the rest of the UI, preventing them from responding to user input when the UI is in a disabled state. ## Impact This PR enhances the consistency of `egui`'s UI behavior by ensuring that all elements, including `ScrollArea` and `Plot`, respect the UI's disabled state. This prevents unexpected interactions when the UI is disabled. Closes emilk#4341
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 theScrollArea
.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
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):
The text was updated successfully, but these errors were encountered: