Hide the hovered sheet when the grid scrolls (#73)
A wheel scroll moves cards under a still pointer without a hover event, so the sheet could stay on a card no longer under it. The grid now forgets the hovered card on scroll; the next mouse move hovers the right one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
796fae11b7
commit
05b8cc6d60
2 files changed
+29
No files matched your search
@@ -284,6 +284,13 @@ impl Render for CardGrid {
|
||||
.relative()
|
||||
.size_full()
|
||||
.key_context(CONTEXT)
|
||||
// A wheel scroll moves cards under a still pointer without a hover event: the
|
||||
// sheet of the card that was under it would stay. The next mouse move hovers again.
|
||||
.on_scroll(cx.listener(|grid, _: &ScrollEvent, _, cx| {
|
||||
if grid.hovered.take().is_some() {
|
||||
cx.notify();
|
||||
}
|
||||
}))
|
||||
.on_action(cx.listener(|grid, _: &NextCard, window, cx| grid.move_focus(1, window, cx)))
|
||||
.on_action(
|
||||
cx.listener(|grid, _: &PreviousCard, window, cx| grid.move_focus(-1, window, cx)),
|
||||
|
||||
Reference in new issue
Block a user