Simplify canvas control focus guard for strict lint

This commit is contained in:
2026-09-11 11:08:37 -07:00
parent 82fd0acf64
commit abffa4b3f0
@@ -158,14 +158,12 @@ impl<Message: Clone, R: renderer::Renderer> Widget<Message, Theme, R> for Contro
if matches!(
event,
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
) {
if !layout
.bounds()
.intersection(viewport)
.is_some_and(|bounds| cursor.is_over(bounds))
{
state.focused = false;
}
) && !layout
.bounds()
.intersection(viewport)
.is_some_and(|bounds| cursor.is_over(bounds))
{
state.focused = false;
}
}
if matches!(event, Event::Window(iced::window::Event::Unfocused)) {