Skip to content

Commit 40f70ea

Browse files
committed
feat(contextview): attach mac css class and default append view to workbench
1 parent 2f6a071 commit 40f70ea

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/contextview/index.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
IPosition,
99
} from 'mo/common/dom';
1010
import './style.scss';
11+
import { Utils } from 'dt-utils/lib';
1112

1213
export interface IContextViewProps {
1314
render?: () => React.ReactNode;
@@ -60,9 +61,14 @@ export function useContextView(props?: IContextViewProps): IContextView {
6061

6162
if (!contextView) {
6263
contextView = document.createElement('div');
63-
contextView.className = claName;
64+
contextView.className = classNames(claName, Utils.isMacOs() ? 'mac' : null);
6465
contextView.style.display = 'none';
65-
document.body.appendChild(contextView);
66+
const root = document.getElementById('molecule');
67+
if (!root) {
68+
document.body.appendChild(contextView);
69+
} else {
70+
root.appendChild(contextView);
71+
}
6672

6773
ReactDOM.render(
6874
<>

0 commit comments

Comments
 (0)