Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] Fix z-indexing for custom alert provider #20192

Merged
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 @@ -24,9 +24,9 @@ export const Dialog = (props: Props) => {
return (
<BlueprintDialog
{...rest}
portalClassName="dagster-portal"
portalClassName={`dagster-portal${props.portalClassName ? ` ${props.portalClassName}` : ''}`}
backdropClassName="dagster-backdrop"
className="dagster-dialog"
className={`dagster-dialog${props.className ? ` ${props.className}` : ''}`}
>
{title ? <DialogHeader icon={icon} label={title} /> : null}
<ErrorBoundary region="dialog">{children}</ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {createGlobalStyle} from 'styled-components';
import {SubscriptionClient} from 'subscriptions-transport-ws';

import {AppContext} from './AppContext';
import {CustomAlertProvider} from './CustomAlertProvider';
import {CustomAlertProvider, GlobalCustomAlertPortalStyle} from './CustomAlertProvider';
import {CustomConfirmationProvider} from './CustomConfirmationProvider';
import {LayoutProvider} from './LayoutProvider';
import {PermissionsProvider} from './Permissions';
Expand Down Expand Up @@ -211,6 +211,7 @@ export const AppProvider = (props: AppProviderProps) => {
<GlobalTooltipStyle />
<GlobalPopoverStyle />
<GlobalDialogStyle />
<GlobalCustomAlertPortalStyle />
<GlobalSuggestStyle />
<ApolloProvider client={apolloClient}>
<AssetLiveDataProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Button, Dialog, DialogBody, DialogFooter, FontFamily} from '@dagster-io/ui-components';
import * as React from 'react';
import styled from 'styled-components';
import styled, {createGlobalStyle} from 'styled-components';

import {copyValue} from './DomUtils';
import {testId} from '../testing/testId';
Expand Down Expand Up @@ -73,6 +73,7 @@ export const CustomAlertProvider = () => {
onClose={() => setCustomAlert(null)}
style={{width: 'auto', maxWidth: '80vw'}}
isOpen={!!alert}
portalClassName="custom-alert-portal"
>
{alert ? (
<DialogBody data-testid={testId('alert-body')}>
Expand All @@ -96,3 +97,9 @@ const Body = styled.div`
font-family: ${FontFamily.monospace};
font-size: 16px;
`;

export const GlobalCustomAlertPortalStyle = createGlobalStyle`
.custom-alert-portal {
z-index: 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets try z-index: 1; here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm if the current value is making them appear beneath editor modals I could see >1 being necessary here - Feels like just about nothing should appear above the alert portal so this might be a case where a superbig number is ok...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bengotow I think currently nothing is setting a z-index but because this dialog renders first it ends being displayed at the bottom. I think as long as nothing is setting a z-index then a value of 1 would be fine but yeah a large value is probably more future proof.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like just about nothing should appear above the alert portal

Yeah, though we use the custom alert for lots of stuff that isn't really alerting. :(

}
`;
Loading