-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Revert displaying popovers as modals on mobile for now #7392
Conversation
import {style} from '../style' with {type: 'macro'}; | ||
import {StyleString} from '../style/types' with {type: 'macro'}; | ||
import {useDOMRef, useIsMobileDevice} from '@react-spectrum/utils'; | ||
import {useDOMRef} from '@react-spectrum/utils'; | ||
|
||
export interface PopoverProps extends UnsafeStyles, Omit<AriaPopoverProps, 'arrowSize' | 'isNonModal' | 'arrowBoundaryOffset' | 'isKeyboardDismissDisabled' | 'shouldCloseOnInteractOutside' | 'shouldUpdatePosition'> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we get rid of the mobileType prop for now if we're not showing popovers as modals on mobile?
## API Changes
@react-spectrum/s2/@react-spectrum/s2:Popover Popover {
UNSAFE_className?: string
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
containerPadding?: number = 12
crossOffset?: number = 0
hideArrow?: boolean = false
id?: string | undefined
- mobileType?: 'modal' | 'fullscreen' | 'fullscreenTakeover'
offset?: number = 8
placement?: Placement = 'bottom'
role?: 'dialog' | 'alertdialog' = 'dialog'
shouldFlip?: boolean = true
slot?: string | null
styles?: StylesProp
} /@react-spectrum/s2:PopoverProps PopoverProps {
UNSAFE_className?: string
UNSAFE_style?: CSSProperties
UNSTABLE_portalContainer?: Element = document.body
boundaryElement?: Element = document.body
children?: ReactNode | ((PopoverRenderProps & {
defaultChildren: ReactNode | undefined
})) => ReactNode
className?: string | ((PopoverRenderProps & {
defaultClassName: string | undefined
})) => string
containerPadding?: number = 12
crossOffset?: number = 0
defaultOpen?: boolean
hideArrow?: boolean = false
isEntering?: boolean
isExiting?: boolean
isOpen?: boolean
maxHeight?: number
- mobileType?: 'modal' | 'fullscreen' | 'fullscreenTakeover'
offset?: number = 8
onOpenChange?: (boolean) => void
placement?: Placement = 'bottom'
scrollRef?: RefObject<Element | null> = overlayRef
size?: 'S' | 'M' | 'L'
slot?: string | null
style?: CSSProperties | ((PopoverRenderProps & {
defaultStyle: CSSProperties
})) => CSSProperties | undefined
styles?: StyleString
trigger?: string
triggerRef?: RefObject<Element | null>
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, verified that Combobox/Picker/ContextualHelp, etc are all rendering as popovers again now and that FullScreenDialog has additional padding when the buttons shift down now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -126,6 +123,9 @@ let popover = style({ | |||
L: 576 | |||
} | |||
}, | |||
// Don't be larger than full screen minus 2 * containerPadding | |||
maxWidth: '[calc(100vw - 24px)]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are scrollbars showing, this will still position and look okay, right?
Until we implement trays, we won't display popovers as modals on mobile. Also includes some example improvements, and fixes #7352 (comment)