mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-25 05:07:05 +00:00
fix(web): keep jump-to-bottom visible in history (#2304)
This commit is contained in:
@@ -224,6 +224,25 @@ function renderSearchThread(options: {
|
||||
}
|
||||
|
||||
describe('mobile initial scroll settling', () => {
|
||||
it('shows the jump control during continuous upward scrolling and hides it at the bottom', () => {
|
||||
const { viewport, queryByRole } = renderThread()
|
||||
act(() => { vi.advanceTimersByTime(3_000) })
|
||||
viewport.scrollTop = 702
|
||||
fireEvent.scroll(viewport)
|
||||
expect(queryByRole('button', { name: /scroll to bottom/i })).toBeNull()
|
||||
|
||||
viewport.scrollTop = 600
|
||||
fireEvent.scroll(viewport)
|
||||
expect(queryByRole('button', { name: /scroll to bottom/i })).not.toBeNull()
|
||||
viewport.scrollTop = 400
|
||||
fireEvent.scroll(viewport)
|
||||
expect(queryByRole('button', { name: /scroll to bottom/i })).not.toBeNull()
|
||||
|
||||
viewport.scrollTop = 702
|
||||
fireEvent.scroll(viewport)
|
||||
expect(queryByRole('button', { name: /scroll to bottom/i })).toBeNull()
|
||||
})
|
||||
|
||||
it('uses the explicit tail transition when a send requests a forced scroll', () => {
|
||||
const onViewModeChange = vi.fn()
|
||||
const onJumpToTail = vi.fn()
|
||||
|
||||
Reference in New Issue
Block a user