Merge pull request #1496 from tarkah/fix/dropdown-scrollable

Fix drop down not closing when inside scrollable
This commit is contained in:
Héctor Ramón 2022-10-29 01:45:00 +02:00 committed by GitHub
commit 0eb24bd56a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -348,9 +348,9 @@ where
let state = state();
let event_status = if state.is_open {
// TODO: Encode cursor availability in the type system
state.is_open =
cursor_position.x < 0.0 || cursor_position.y < 0.0;
// Event wasn't processed by overlay, so cursor was clicked either outside it's
// bounds or on the drop-down, either way we close the overlay.
state.is_open = false;
event::Status::Captured
} else if layout.bounds().contains(cursor_position) {