@uiw/react-md-editor 3.9.9 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import Child from './Child';
6
6
  import './index.less';
7
7
 
8
8
  export interface IToolbarProps extends IProps {
9
+ overflow?: boolean;
9
10
  height?: React.CSSProperties['height'];
10
11
  onCommand?: (command: ICommand<string>, groupName?: string) => void;
11
12
  commands?: ICommand<string>[];
@@ -13,7 +14,7 @@ export interface IToolbarProps extends IProps {
13
14
  }
14
15
 
15
16
  export function ToolbarItems(props: IToolbarProps) {
16
- const { prefixCls } = props;
17
+ const { prefixCls, overflow } = props;
17
18
  const { fullscreen, preview, barPopup = {}, commandOrchestrator, dispatch } = useContext(EditorContext);
18
19
  const originalOverflow = useRef('');
19
20
 
@@ -47,7 +48,7 @@ export function ToolbarItems(props: IToolbarProps) {
47
48
  }
48
49
 
49
50
  useEffect(() => {
50
- if (document) {
51
+ if (document && overflow) {
51
52
  if (fullscreen) {
52
53
  // prevent scroll on fullscreen
53
54
  document.body.style.overflow = 'hidden';
@@ -60,7 +61,7 @@ export function ToolbarItems(props: IToolbarProps) {
60
61
  document.body.style.overflow = originalOverflow.current;
61
62
  }
62
63
  }
63
- }, [fullscreen, originalOverflow]);
64
+ }, [fullscreen, originalOverflow, overflow]);
64
65
 
65
66
  return (
66
67
  <ul>
@@ -102,6 +103,7 @@ export function ToolbarItems(props: IToolbarProps) {
102
103
  )}
103
104
  {item.children && (
104
105
  <Child
106
+ overflow={overflow}
105
107
  groupName={item.groupName}
106
108
  prefixCls={prefixCls}
107
109
  children={childNode}