Skip to content

Commit

Permalink
Allow scrolling the page when over the monaco editor (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Aug 2, 2022
1 parent 67f1dd2 commit f00a26b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/toolpad-app/src/components/MonacoEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,17 @@ export default React.forwardRef<MonacoEditorHandle, MonacoEditorProps>(function

const extraOptions: EditorOptions = {
readOnly: disabled,
scrollbar: {
alwaysConsumeMouseWheel: false,
...options?.scrollbar,
},
...options,
};

let instance = instanceRef.current;

if (instance) {
if (extraOptions) {
instance.updateOptions(extraOptions);
}
instance.updateOptions(extraOptions);

const model = instance.getModel();
if (typeof value === 'string' && model) {
Expand Down

0 comments on commit f00a26b

Please sign in to comment.