Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/react-core/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export interface ModalProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
/** Modal handles pressing of the escape key and closes the modal. If you want to handle
* this yourself you can use this callback function. */
onEscapePress?: (event: KeyboardEvent) => void;
/** Alternate position of the modal. */
position?: 'top';
/** Position of the modal. By default a modal will be positioned vertically and horizontally centered. */
position?: 'default' | 'top';
/** Offset from alternate position. Can be any valid CSS length/percentage. */
positionOffset?: string;
/** Flag to show the close button in the header area of the modal. */
Expand Down Expand Up @@ -113,7 +113,8 @@ export class Modal extends React.Component<ModalProps, ModalState> {
variant: 'default',
hasNoBodyWrapper: false,
appendTo: () => document.body,
ouiaSafe: true
ouiaSafe: true,
position: 'default'
};

constructor(props: ModalProps) {
Expand Down Expand Up @@ -230,6 +231,7 @@ export class Modal extends React.Component<ModalProps, ModalState> {
titleLabel,
ouiaId,
ouiaSafe,
position,
...props
} = this.props;
const { container } = this.state;
Expand All @@ -254,6 +256,7 @@ export class Modal extends React.Component<ModalProps, ModalState> {
bodyAriaRole={bodyAriaRole}
ouiaId={ouiaId !== undefined ? ouiaId : this.state.ouiaStateId}
ouiaSafe={ouiaSafe}
position={position}
/>,
container
) as React.ReactElement;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-core/src/components/Modal/ModalBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export interface ModalBoxProps extends React.HTMLProps<HTMLDivElement> {
children: React.ReactNode;
/** Additional classes added to the modal box. */
className?: string;
/** Alternate position of the modal. */
position?: 'top';
/** Position of the modal. By default a modal will be positioned vertically and horizontally centered. */
position?: 'default' | 'top';
/** Offset from alternate position. Can be any valid CSS length/percentage. */
positionOffset?: string;
/** Variant of the modal. */
Expand Down
4 changes: 2 additions & 2 deletions packages/react-core/src/components/Modal/ModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ export interface ModalContentProps extends OUIAProps {
labelId: string;
/** A callback for when the close button is clicked. */
onClose?: () => void;
/** Alternate position of the modal. */
position?: 'top';
/** Position of the modal. By default a modal will be positioned vertically and horizontally centered. */
position?: 'default' | 'top';
/** Offset from alternate position. Can be any valid CSS length/percentage. */
positionOffset?: string;
/** Flag to show the close button in the header area of the modal. */
Expand Down