From 29f6daa1e5e240b1cc974767577d99649240e424 Mon Sep 17 00:00:00 2001 From: Andrey Morozov Date: Mon, 17 Jun 2024 18:32:20 +0300 Subject: [PATCH] fix(Dialog): render error popup inside the dialog --- src/components/Dialog/DialogFooter/DialogFooter.tsx | 1 + src/components/Dialog/__stories__/Dialog.stories.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Dialog/DialogFooter/DialogFooter.tsx b/src/components/Dialog/DialogFooter/DialogFooter.tsx index 5443699078..7783dbae73 100644 --- a/src/components/Dialog/DialogFooter/DialogFooter.tsx +++ b/src/components/Dialog/DialogFooter/DialogFooter.tsx @@ -134,6 +134,7 @@ export class DialogFooter extends React.Component { anchorRef={this.errorTooltipRef} placement={['bottom', 'top']} disableLayer + disablePortal hasArrow >
{errorText}
diff --git a/src/components/Dialog/__stories__/Dialog.stories.tsx b/src/components/Dialog/__stories__/Dialog.stories.tsx index d8acb91472..e331414ff2 100644 --- a/src/components/Dialog/__stories__/Dialog.stories.tsx +++ b/src/components/Dialog/__stories__/Dialog.stories.tsx @@ -11,9 +11,14 @@ import {DialogShowcase} from './DialogShowcase'; export default { title: 'Components/Overlays/Dialog', component: Dialog, + argTypes: { + showError: { + type: 'boolean', + }, + }, } as Meta; -const DefaultTemplate: StoryFn = (args) => { +const DefaultTemplate: StoryFn = ({showError, ...args}) => { const dialogTitleId = 'app-confirmation-dialog-title'; const [open, setOpen] = React.useState(false); return ( @@ -37,6 +42,8 @@ const DefaultTemplate: StoryFn = (args) => { onClickButtonApply={() => alert('onApply')} textButtonApply="Apply" textButtonCancel="Cancel" + showError={showError} + errorText="Error text" />