Skip to content

Commit 748d58a

Browse files
committed
!fixup Prevent cumulative layout shift when richworkspace is loading
Instead of only increasing editor height with growing document length, let's stick to a fixed height (150px) and use that one already while loading the document. The editor still increases when it gets focused. Fixes: #2834 Fixes: #2803 Signed-off-by: Jonas <jonas@freesources.org>
1 parent 254a76d commit 748d58a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/views/RichWorkspace.vue

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export default {
203203
z-index: 61;
204204
position: relative;
205205
&.creatable {
206-
min-height: 100px;
206+
min-height: 150px;
207207
}
208208
}
209209
@@ -259,15 +259,19 @@ export default {
259259
}
260260
261261
#rich-workspace.focus {
262-
min-height: 25vh;
262+
min-height: 150px;
263263
max-height: 50vh;
264264
}
265265
266266
#rich-workspace:not(.focus), #rich-workspace.icon-loading {
267-
min-height: 25vh;
268-
max-height: 25vh;
267+
min-height: 150px;
268+
max-height: 150px;
269269
position: relative;
270270
overflow: hidden;
271+
272+
:deep([data-text-el="menubar"]) {
273+
display: none;
274+
}
271275
}
272276
273277
#rich-workspace:not(.focus):not(.icon-loading):not(.empty):after {
@@ -285,10 +289,4 @@ export default {
285289
#rich-workspace.dark:not(.focus):not(.icon-loading):after {
286290
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--color-main-background));
287291
}
288-
289-
@media only screen and (max-width: 1024px) {
290-
#rich-workspace:not(.focus) {
291-
max-height: 30vh;
292-
}
293-
}
294292
</style>

0 commit comments

Comments
 (0)