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
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const FatalError: Story = {
const canvas = within(canvasElement.parentElement!);
const button = canvas.getByText('Open modal');
await userEvent.click(button);
await expect(canvas.findByText('Storybook Tests error details')).resolves.toBeInTheDocument();
await expect(canvas.findByText('Storybook Test Error Details')).resolves.toBeInTheDocument();
},
};

Expand Down
5 changes: 3 additions & 2 deletions code/addons/vitest/src/components/GlobalErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const ModalTitle = styled(Modal.Title)(({ theme: { typography } }) => ({
const ModalStackTrace = styled.pre(({ theme }) => ({
whiteSpace: 'pre-wrap',
wordWrap: 'break-word',
userSelect: 'text',
overflow: 'auto',
maxHeight: '60vh',
margin: 0,
Expand Down Expand Up @@ -147,9 +148,9 @@ export function GlobalErrorModal({ onRerun, storeState }: GlobalErrorModalProps)
) : null;

return (
<Modal ariaLabel="Storybook Tests error details" onOpenChange={setModalOpen} open={isModalOpen}>
<Modal ariaLabel="Storybook Test Error Details" onOpenChange={setModalOpen} open={isModalOpen}>
<ModalBar>
<ModalTitle>Storybook Tests error details</ModalTitle>
<ModalTitle>Storybook Test Error Details</ModalTitle>
<ModalActionBar>
<Button onClick={onRerun} variant="ghost" ariaLabel={false}>
<SyncIcon />
Expand Down
29 changes: 16 additions & 13 deletions code/core/src/components/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,22 @@ function BaseModal({
/>
<div role="dialog" aria-label={ariaLabel} ref={overlayRef} {...finalModalProps}>
<ModalContext.Provider value={{ close }}>
{/* We need to set the FocusScope ourselves somehow, Overlay won't set it. */}
<Components.Container
data-deprecated={deprecated}
$variant={variant}
$status={status}
$transitionDuration={transitionDuration}
className={className}
width={width}
height={height}
{...props}
>
{children}
</Components.Container>
{/* This div exists to help the FocusScope, see https://github.com/adobe/react-spectrum/issues/1604. */}
<div tabIndex={-1}>
{/* We need to set the FocusScope ourselves somehow, Overlay won't set it. */}
<Components.Container
data-deprecated={deprecated}
$variant={variant}
$status={status}
$transitionDuration={transitionDuration}
className={className}
width={width}
height={height}
{...props}
>
{children}
</Components.Container>
</div>
</ModalContext.Provider>
</div>
</FocusScope>
Expand Down
Loading