Skip to content

Commit eb45219

Browse files
committed
fix horizontal scrolling in the code editor
1 parent 5938905 commit eb45219

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

code-editor/assets/dioxus-code-editor.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
.dxc-editor-viewport {
2424
min-height: 100%;
25-
min-width: 0;
25+
min-width: 100%;
2626
position: relative;
27+
width: max-content;
2728
}
2829

2930
.dxc-editor-gutter,
@@ -40,13 +41,18 @@
4041
}
4142

4243
.dxc-editor-gutter {
44+
background: inherit;
4345
color: var(--muted, currentColor);
46+
left: 0;
4447
padding: var(--dxc-editor-gutter-padding, 14px 0);
4548
pointer-events: none;
49+
position: sticky;
4650
user-select: none;
51+
z-index: 2;
4752
}
4853

4954
.dxc-editor-highlight {
55+
min-width: 100%;
5056
pointer-events: none;
5157
}
5258

@@ -67,7 +73,7 @@
6773
letter-spacing: 0;
6874
margin: 0;
6975
outline: none;
70-
overflow: hidden;
76+
overflow: clip;
7177
overflow-wrap: normal;
7278
position: absolute;
7379
resize: none;

docsite/assets/app.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3396,11 +3396,6 @@ a {
33963396
color: var(--editor-gutter-fg);
33973397
}
33983398

3399-
.playground-code-editor .dxc-editor-highlight,
3400-
.playground-code-editor .dxc-editor-input {
3401-
overflow-x: auto;
3402-
}
3403-
34043399
.editor-meta {
34053400
align-items: center;
34063401
display: inline-flex;

0 commit comments

Comments
 (0)