Skip to content

Commit 435e5f0

Browse files
authored
webview: Fix webview flickering. (#439)
Rewrote styling for the webview so that it takes the whole window when the app loads up. Fixes #249.
1 parent 603ad7d commit 435e5f0

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

app/renderer/css/main.css

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ body {
2828
-webkit-app-region: drag;
2929
overflow: hidden;
3030
transition: all 0.5s ease;
31-
z-index: 1;
31+
z-index: 2;
3232
}
3333

3434
.toggle-sidebar div {
@@ -249,28 +249,34 @@ body {
249249
}
250250

251251
webview {
252-
opacity: 1;
253252
/* transition: opacity 0.3s ease-in; */
254253
flex-grow: 1;
254+
position: absolute;
255+
width: 100%;
256+
height: 100%;
257+
flex-grow: 1;
258+
display: flex;
259+
flex-direction: column;
255260
}
256261

257262
webview.onload {
258263
transition: opacity 1s cubic-bezier(0.95, 0.05, 0.795, 0.035);
259264
}
260265

266+
webview.active {
267+
opacity: 1;
268+
z-index: 1;
269+
visibility: visible;
270+
}
271+
261272
webview.disabled {
262-
flex: 0 1;
263-
height: 0;
264-
width: 0;
265273
opacity: 0;
266-
transition: opacity 0.3s ease-out;
267274
}
268275

269-
webview:focus {
276+
webview.focus {
270277
outline: 0px solid transparent;
271278
}
272279

273-
274280
/* Tooltip styling */
275281

276282
#back-tooltip,

app/renderer/js/components/webview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class WebView extends BaseComponent {
130130
}
131131

132132
this.$el.classList.remove('disabled');
133+
this.$el.classList.add('active');
133134
setTimeout(() => {
134135
if (this.props.role === 'server') {
135136
this.$el.classList.remove('onload');
@@ -168,6 +169,7 @@ class WebView extends BaseComponent {
168169

169170
hide() {
170171
this.$el.classList.add('disabled');
172+
this.$el.classList.remove('active');
171173
}
172174

173175
load() {

0 commit comments

Comments
 (0)