Add an overlay that is invisible.
We will put a second copy of the input text in here invisibly, so we can create overlay spans.
This commit is contained in:
parent
636f2dabb8
commit
949e02af2f
@ -8,6 +8,7 @@
|
||||
.Editor-textwrapper {
|
||||
flex: 1;
|
||||
flex-basis: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.Editor-textarea {
|
||||
@ -19,3 +20,12 @@
|
||||
flex: 1;
|
||||
background: green;
|
||||
}
|
||||
|
||||
.Editor-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
@ -8,7 +8,8 @@ function Editor() {
|
||||
return (
|
||||
<div className="Editor">
|
||||
<div className="Editor-textwrapper">
|
||||
<textarea onChange={handleChange} className="Editor-textarea"></textarea>
|
||||
<div className="Editor-overlay"></div>
|
||||
<textarea onChange={handleChange} className="Editor-textarea">I have text</textarea>
|
||||
</div>
|
||||
<div className="Editor-ast"></div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user