diff --git a/crates/ui-canvas/src/canvas/scrollbars/stories.rs b/crates/ui-canvas/src/canvas/scrollbars/stories.rs index 48e2dc890..9cf97f9aa 100644 --- a/crates/ui-canvas/src/canvas/scrollbars/stories.rs +++ b/crates/ui-canvas/src/canvas/scrollbars/stories.rs @@ -45,13 +45,13 @@ fn drag_thumb(fixture: &mut Fixture) { fixture.drag(&grip, Vec2::new(DRAG_THRESHOLDS * threshold, 0.0)); } -/// Presses the vertical thumb and drags it down, holding the button at the end so the tip stays up. +/// Presses the vertical thumb, drags it down and releases it: the gesture the shared drive cases expect to end once. fn drag_vertical_thumb(fixture: &mut Fixture) { let Some(id) = fixture.root_id() else { return }; let Some(track) = fixture.part(id, VERTICAL) else { return }; let threshold = crate::testing::input::slop(fixture.ctx()); let grip = track.rect.center_top() + vec2(0.0, GRIP_THRESHOLDS * threshold); - fixture.drag_hold_at(grip, Vec2::new(0.0, DRAG_THRESHOLDS * threshold)); + fixture.drag_at(grip, Vec2::new(0.0, DRAG_THRESHOLDS * threshold)); } /// The tip beside a dragged vertical thumb: the bars show it on the reading-start side while the thumb drags. diff --git a/crates/ui-canvas/tests/it/canvas/scrollbars.rs b/crates/ui-canvas/tests/it/canvas/scrollbars.rs index 7ded007dd..ede942417 100644 --- a/crates/ui-canvas/tests/it/canvas/scrollbars.rs +++ b/crates/ui-canvas/tests/it/canvas/scrollbars.rs @@ -147,6 +147,8 @@ fn a_dragged_vertical_thumb_shows_the_tip_beside_it_and_nothing_when_it_is_not_d assert!(tip.right() <= bar.left() + 0.5, "the tip is beside the bar on the reading-start side: {tip:?} by {bar:?}"); assert!(tip.bottom() > bar.top() && tip.top() < bar.bottom(), "level with the track: {tip:?}"); fixture.release_at(from + by); + // The tip leaves as every popup does, through its exit fade. + fixture.settle(); assert_eq!(shows_tip(&fixture), None, "the release ends the tip"); fixture.idle(2); assert_eq!(shows_tip(&fixture), None, "nothing is kept after it");