Skip to content

Commit a6f0d45

Browse files
authored
fix(S2): fix Modal position and S2 docs modal style (#9007)
* revert S2 modal position change * fix S2 docs menu modal position * s2: fix ModalProps types
1 parent d3de908 commit a6f0d45

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/@react-spectrum/s2/src/Modal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
import {colorScheme} from './style-utils' with {type: 'macro'};
1414
import {ColorSchemeContext} from './Provider';
15-
import {DOMRef} from '@react-types/shared';
15+
import {DOMRef, GlobalDOMAttributes} from '@react-types/shared';
1616
import {forwardRef, MutableRefObject, useCallback, useContext} from 'react';
1717
import {ModalOverlay, ModalOverlayProps, Modal as RACModal, useLocale} from 'react-aria-components';
1818
import {style} from '../style' with {type: 'macro'};
1919
import {useDOMRef} from '@react-spectrum/utils';
2020

21-
interface ModalProps extends ModalOverlayProps {
21+
interface ModalProps extends Omit<ModalOverlayProps, 'className' | 'style' | keyof GlobalDOMAttributes> {
2222
/**
2323
* The size of the Modal.
2424
*
@@ -29,7 +29,7 @@ interface ModalProps extends ModalOverlayProps {
2929

3030
const modalOverlayStyles = style({
3131
...colorScheme(),
32-
position: 'fixed',
32+
position: 'absolute',
3333
top: 0,
3434
left: 0,
3535
width: 'full',

packages/dev/s2-docs/src/MobileHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export function MobileHeader({toc, pages, currentPage}) {
162162
<ActionButton aria-label="Navigation" isQuiet>
163163
<MenuHamburger />
164164
</ActionButton>
165-
<Modal size="fullscreenTakeover" style={{zIndex: 100, height: '100dvh'}}>
165+
<Modal size="fullscreenTakeover">
166166
<MobileSearchMenu pages={pages} currentPage={currentPage} />
167167
</Modal>
168168
</DialogTrigger>

0 commit comments

Comments
 (0)