Skip to content

Commit

Permalink
[ui] Fix config dialog scrolling (#16975)
Browse files Browse the repository at this point in the history
## Summary & Motivation

Some recent CodeMirror changes led to the config dialogs being
unscrollable. Repair this by setting a height and overflow style on the
CodeMirror target div.

## How I Tested These Changes

View config dialogs (code location config, run config), Deployment
configuration page, launchpad. Verify that CodeMirror containers are
properly scrollable.
  • Loading branch information
hellendag authored Oct 3, 2023
1 parent c235be0 commit bb6f1ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ export const RawCodeMirror = (props: Props) => {
}
}, [options]);

return <div ref={target} />;
return <div style={{height: '100%', overflow: 'hidden'}} ref={target} />;
};
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ export const InstanceConfig = React.memo(() => {
Dagster version: <Code style={{fontSize: '16px'}}>{data.version}</Code>
</Subheading>
</Box>
<StyledRawCodeMirror
value={config || ''}
options={{readOnly: true, lineNumbers: true, mode: 'yaml'}}
handlers={handlers}
theme={['instance-config']}
/>
{/* Div wrapper on CodeMirror to allow entire page to scroll */}
<div>
<StyledRawCodeMirror
value={config || ''}
options={{readOnly: true, lineNumbers: true, mode: 'yaml'}}
handlers={handlers}
theme={['instance-config']}
/>
</div>
</>
);
});
Expand Down

2 comments on commit bb6f1ef

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-2vz9wqw46-elementl.vercel.app

Built with commit bb6f1ef.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-77lu0ggv0-elementl.vercel.app

Built with commit bb6f1ef.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.