Skip to content

Commit

Permalink
fix(Dialog): render error popup inside the dialog (#1657)
Browse files Browse the repository at this point in the history
  • Loading branch information
amje authored Jun 17, 2024
1 parent c3816e6 commit edf6473
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Dialog/DialogFooter/DialogFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export class DialogFooter extends React.Component<DialogFooterInnerProps> {
anchorRef={this.errorTooltipRef}
placement={['bottom', 'top']}
disableLayer
disablePortal
hasArrow
>
<div className={b('error')}>{errorText}</div>
Expand Down
9 changes: 8 additions & 1 deletion src/components/Dialog/__stories__/Dialog.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ import {DialogShowcase} from './DialogShowcase';
export default {
title: 'Components/Overlays/Dialog',
component: Dialog,
argTypes: {
showError: {
type: 'boolean',
},
},
} as Meta<DialogProps>;

const DefaultTemplate: StoryFn<DialogProps> = (args) => {
const DefaultTemplate: StoryFn<DialogProps & {showError: boolean}> = ({showError, ...args}) => {
const dialogTitleId = 'app-confirmation-dialog-title';
const [open, setOpen] = React.useState(false);
return (
Expand All @@ -37,6 +42,8 @@ const DefaultTemplate: StoryFn<DialogProps> = (args) => {
onClickButtonApply={() => alert('onApply')}
textButtonApply="Apply"
textButtonCancel="Cancel"
showError={showError}
errorText="Error text"
/>
</Dialog>
</React.Fragment>
Expand Down

0 comments on commit edf6473

Please sign in to comment.