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
8 changes: 4 additions & 4 deletions packages/react-core/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styles from '@patternfly/react-styles/css/components/Backdrop/backdrop';
import { ModalContent } from './ModalContent';
import { OUIAProps, getDefaultOUIAId } from '../../helpers';

export interface ModalProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
export interface ModalProps extends Omit<React.HTMLProps<HTMLDivElement>, 'title'>, OUIAProps {
/** Action buttons to add to the standard modal footer. Ignored if the footer property
* is passed in.
*/
Expand Down Expand Up @@ -64,8 +64,8 @@ export interface ModalProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
positionOffset?: string;
/** Flag to show the close button in the header area of the modal. */
showClose?: boolean;
/** Simple text content of the modal header. Also used for the aria-label on the body. */
title?: string;
/** Text content of the modal header. */
title?: React.ReactNode;
/** Optional alert icon (or other) to show before the title of the modal header. When the
* predefined alert types are used the default styling will be automatically applied.
*/
Expand Down Expand Up @@ -186,7 +186,7 @@ class Modal extends React.Component<ModalProps, ModalState> {
target.classList.remove(css(styles.backdropOpen));
}

if (this.isEmpty(title) && this.isEmpty(ariaLabel) && this.isEmpty(ariaLabelledby)) {
if (!title && this.isEmpty(ariaLabel) && this.isEmpty(ariaLabelledby)) {
// eslint-disable-next-line no-console
console.error('Modal: Specify at least one of: title, aria-label, aria-labelledby.');
}
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 @@ -71,8 +71,8 @@ export interface ModalContentProps extends OUIAProps {
positionOffset?: string;
/** Flag to show the close button in the header area of the modal. */
showClose?: boolean;
/** Simple text content of the modal header. Also used for the aria-label on the body. */
title?: string;
/** Text content of the modal header. */
title?: React.ReactNode;
/** Optional alert icon (or other) to show before the title of the modal header. When the
* predefined alert types are used the default styling will be automatically applied.
*/
Expand Down