Skip to content

Commit f582f63

Browse files
committed
feat: add styles for single-line mode and suggestion menu anchor in EditorInput
1 parent 5be6847 commit f582f63

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/components/form/EditorInput.style.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
// Single-line mode for the Slate Editable. white-space needs !important
2+
// because Editable sets `white-space: pre-wrap` as an inline style, which
3+
// would otherwise beat any stylesheet rule.
4+
.input-wrapper__control--single-line {
5+
white-space: pre !important;
6+
overflow-x: auto;
7+
overflow-y: hidden;
8+
scrollbar-width: none;
9+
10+
&::-webkit-scrollbar {
11+
display: none;
12+
}
13+
}
14+
15+
// Invisible Radix anchor for the suggestion menu — a sibling of .editor-input
16+
// inside .input-wrapper. updateTriggerPosition() moves it to the caret via
17+
// inline left/top/height, which intentionally override these initial values.
18+
.editor-input__menu-anchor {
19+
position: absolute;
20+
left: 0;
21+
top: 0;
22+
width: 0;
23+
height: 0;
24+
opacity: 0;
25+
pointer-events: none;
26+
}
27+
128
.editor-input {
229
width: 100%;
330
overflow: hidden;

0 commit comments

Comments
 (0)