Skip to content

Commit

Permalink
In non-highlighted mode, show the original textarea text. not the sha…
Browse files Browse the repository at this point in the history
…dow one (should fix #9)
  • Loading branch information
iafan committed Jun 18, 2017
1 parent 07c4835 commit 0a4152f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion client/component/editor/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,10 @@ func (ed *Editor) Render() *vecty.HTML {
return elem.Div(
vecty.ClassMap{"scroller": true},
elem.TextArea(
vecty.ClassMap{"editor": true},
vecty.ClassMap{
"editor": true,
"highlighting": ed.HighlightingMode,
},
vecty.Property("autocapitalize", "off"),
vecty.Attribute("autocomplete", "off"),
vecty.Attribute("autocorrect", "off"),
Expand Down
8 changes: 6 additions & 2 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,14 @@ code, kbd {
background: none;
outline: none;
resize: none;
}

.editor.highlighted {
color: rgba(0,0,0,0);
caret-color: #000;
}

.safari .editor {
.safari .editor.highlighted {
color: #000;
-webkit-text-fill-color: rgba(0,0,0,0);
}
Expand All @@ -237,6 +240,7 @@ code, kbd {

.shadow {
pointer-events: none;
color: rgba(0,0,0,0);
}

.shadow ol {
Expand Down Expand Up @@ -417,7 +421,7 @@ body.dark {
--highlight-com-color: #777;
}

.dark .editor {
.dark .editor.highlighted {
caret-color: #fff;
}

Expand Down

0 comments on commit 0a4152f

Please sign in to comment.