diff --git a/crates/egui/src/response.rs b/crates/egui/src/response.rs index 291ba0d0b..b599f9fd3 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -601,6 +601,13 @@ impl Response { /// ``` #[must_use] pub fn interact(&self, sense: Sense) -> Self { + // Test if we must sense something new compared to what we have already sensed. If not, then + // we can return early. This may avoid unnecessarily "masking" some widgets with unneeded + // interactions. + if (self.sense | sense) == self.sense { + return self.clone(); + } + // Temporary hack for 0.26.1 to avoid breaking change. let clip_rect = self.ctx.graphics(|g| { g.get(self.layer_id)