Skip to content

Commit 14ffd88

Browse files
committed
fix: readonly resize module and fullscreen editor height
1 parent b042f0c commit 14ffd88

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

packages/pluggableWidgets/rich-text-web/src/components/Editor.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ const Editor = forwardRef((props: EditorProps, ref: MutableRefObject<Quill | nul
127127
...QuillTableBetter.keyboardBindings
128128
}
129129
},
130-
resize: RESIZE_MODULE_CONFIG,
131130
table: false,
132131
"table-better": {
133132
language: "en_US",
@@ -139,6 +138,9 @@ const Editor = forwardRef((props: EditorProps, ref: MutableRefObject<Quill | nul
139138
readOnly
140139
};
141140

141+
if (!readOnly && options.modules) {
142+
options.modules.resize = RESIZE_MODULE_CONFIG;
143+
}
142144
const quill = new MxQuill(editorContainer, options);
143145
ref.current = quill;
144146

packages/pluggableWidgets/rich-text-web/src/components/EditorWrapper.tsx

+10-6
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,16 @@ function EditorWrapperInner(props: EditorWrapperProps): ReactElement {
190190
theme={"snow"}
191191
ref={quillRef}
192192
defaultValue={stringAttribute.value}
193-
style={{
194-
height: style?.height,
195-
minHeight: style?.minHeight,
196-
maxHeight: style?.maxHeight,
197-
overflowY: style?.overflowY
198-
}}
193+
style={
194+
isFullscreen
195+
? { height: "100%" }
196+
: {
197+
height: style?.height,
198+
minHeight: style?.minHeight,
199+
maxHeight: style?.maxHeight,
200+
overflowY: style?.overflowY
201+
}
202+
}
199203
toolbarId={shouldHideToolbar ? undefined : toolbarOptions ? toolbarOptions : toolbarId}
200204
onTextChange={onTextChange}
201205
onSelectionChange={onSelectionChange}

packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/Dialog.scss

+5
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
align-items: center;
88
display: flex;
99
z-index: 105;
10+
11+
&.mx-underlay {
12+
z-index: 105;
13+
}
1014
}
1115

1216
&-body {
1317
&.modal-dialog {
18+
z-index: 106;
1419
top: 50%;
1520
left: 50%;
1621
transform: translate(-50%, -50%);

packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/Dialog.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
useRole
1010
} from "@floating-ui/react";
1111
import { If } from "@mendix/widget-plugin-component-kit/If";
12-
import { createElement, ReactElement } from "react";
12+
import { createElement, Fragment, ReactElement } from "react";
1313
import LinkDialog, { LinkDialogProps } from "./LinkDialog";
1414
import VideoDialog, { VideoDialogProps } from "./VideoDialog";
1515
import ViewCodeDialog, { ViewCodeDialogProps } from "./ViewCodeDialog";
@@ -71,10 +71,14 @@ export default function Dialog(props: DialogProps): ReactElement {
7171
return (
7272
<FloatingPortal>
7373
{isOpen && (
74-
<FloatingOverlay lockScroll className="widget-rich-text-modal-overlay">
74+
<Fragment>
75+
<FloatingOverlay
76+
lockScroll
77+
className="widget-rich-text-modal-overlay mx-underlay"
78+
></FloatingOverlay>
7579
<FloatingFocusManager context={context}>
7680
<div
77-
className="Dialog"
81+
className="Dialog mx-layoutgrid"
7882
ref={refs.setFloating}
7983
aria-labelledby={dialogType}
8084
aria-describedby={dialogType}
@@ -94,7 +98,7 @@ export default function Dialog(props: DialogProps): ReactElement {
9498
</If>
9599
</div>
96100
</FloatingFocusManager>
97-
</FloatingOverlay>
101+
</Fragment>
98102
)}
99103
</FloatingPortal>
100104
);

0 commit comments

Comments
 (0)