Skip to content

Commit 8fde4ab

Browse files
committed
fix(Windows + Linux): Fix not clickable window titlebar & menu
Remove need for #portalContainer
1 parent 261a977 commit 8fde4ab

File tree

4 files changed

+9
-35
lines changed

4 files changed

+9
-35
lines changed

src/containers/settings/SettingsWindow.js

+9-25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react';
2-
import ReactDOM from 'react-dom';
32
import PropTypes from 'prop-types';
43
import { observer, inject } from 'mobx-react';
54

@@ -11,18 +10,6 @@ import ErrorBoundary from '../../components/util/ErrorBoundary';
1110
import { workspaceStore } from '../../features/workspaces';
1211

1312
export default @inject('stores', 'actions') @observer class SettingsContainer extends Component {
14-
portalRoot = document.querySelector('#portalContainer');
15-
16-
el = document.createElement('div');
17-
18-
componentDidMount() {
19-
this.portalRoot.appendChild(this.el);
20-
}
21-
22-
componentWillUnmount() {
23-
this.portalRoot.removeChild(this.el);
24-
}
25-
2613
render() {
2714
const { children, stores } = this.props;
2815
const { closeSettings } = this.props.actions.ui;
@@ -35,18 +22,15 @@ export default @inject('stores', 'actions') @observer class SettingsContainer ex
3522
/>
3623
);
3724

38-
return ReactDOM.createPortal(
39-
(
40-
<ErrorBoundary>
41-
<Layout
42-
navigation={navigation}
43-
closeSettings={closeSettings}
44-
>
45-
{children}
46-
</Layout>
47-
</ErrorBoundary>
48-
),
49-
this.el,
25+
return (
26+
<ErrorBoundary>
27+
<Layout
28+
navigation={navigation}
29+
closeSettings={closeSettings}
30+
>
31+
{children}
32+
</Layout>
33+
</ErrorBoundary>
5034
);
5135
}
5236
}

src/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<div class="window-draggable"></div>
1212
<div class="dev-warning">DEV MODE</div>
1313
<div id="root"></div>
14-
<div id="portalContainer"></div>
1514
<script>
1615
document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform);
1716

src/overlay.html

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<!-- <div class="window-draggable"></div> -->
1212
<!-- <button class="dev-warning" onclick="window.close()" style="pointer-events:all;">DEV MODE</button> -->
1313
<div id="root"></div>
14-
<div id="portalContainer"></div>
1514
<script>
1615
document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform);
1716

src/styles/layout.scss

-8
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,4 @@ body.win32 .window-draggable {
172172
width: auto;
173173
z-index: 999999999;
174174
pointer-events: none;
175-
}
176-
177-
#portalContainer {
178-
position: absolute;
179-
top: 0;
180-
left: 0;
181-
width: 100%;
182-
height: 100%;
183175
}

0 commit comments

Comments
 (0)