mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 01:57:41 +02:00
fix(ui): drying popover footer no longer clipped by iOS Safari URL bar (#1669)
100vh and window.innerHeight report the layout viewport on iOS Safari, so the popover's Start Drying button rendered behind the bottom toolbar overlay. Switch the popover maxHeight to 100dvh and default computePopoverPosition's viewportHeight to visualViewport.height (with innerHeight fallback). The flip-above decision and the body-scroll fallback now both run against the actually-visible area, so the footer button stays reachable on iPhone.
This commit is contained in:
@@ -46,11 +46,22 @@ export interface ComputePopoverPositionOpts {
|
||||
* doesn't push the popover off-screen.
|
||||
*/
|
||||
export function computePopoverPosition(opts: ComputePopoverPositionOpts): PopoverPosition {
|
||||
// iOS Safari's bottom URL/toolbar overlay is excluded from window.innerHeight
|
||||
// but included in the layout viewport, so a popover anchored against
|
||||
// innerHeight gets its footer clipped behind the toolbar (#1669, iPhone 17
|
||||
// Safari). visualViewport reflects the actually-visible area when the
|
||||
// toolbar is up; fall back to innerHeight where it isn't available.
|
||||
const visualHeight =
|
||||
typeof window !== 'undefined' && window.visualViewport
|
||||
? window.visualViewport.height
|
||||
: typeof window !== 'undefined'
|
||||
? window.innerHeight
|
||||
: 0;
|
||||
const {
|
||||
triggerRect,
|
||||
popoverWidth,
|
||||
estimatedHeight,
|
||||
viewportHeight = window.innerHeight,
|
||||
viewportHeight = visualHeight,
|
||||
viewportWidth = window.innerWidth,
|
||||
margin = 8,
|
||||
gap = 4,
|
||||
|
||||
Reference in New Issue
Block a user