Fossil SCM

/chat another CSS-side contenteditable portability workaround to keep Firefox from losing newlines on pasted-in text.

stephan 2021-10-07 04:07 trunk
Commit c7fa9f150f5a9c0986e8a4b5aa713e1d5da6c1a3062d713be00b447588bcc007
1 file changed +3
--- src/style.chat.css
+++ src/style.chat.css
@@ -188,10 +188,13 @@
188188
padding: 0.2em;
189189
flex: 10 1 auto;
190190
background-color: rgba(156,156,156,0.3);
191191
overflow: auto;
192192
resize: vertical;
193
+ white-space: pre-wrap;
194
+ /* ^^^ Firefox, when pasting plain text into a contenteditable field,
195
+ loses all newlines unless we explicitly set this. Chrome does not. */
193196
}
194197
#chat-input-field:empty::before {
195198
content: attr(data-placeholder);
196199
opacity: 0.6;
197200
}
198201
--- src/style.chat.css
+++ src/style.chat.css
@@ -188,10 +188,13 @@
188 padding: 0.2em;
189 flex: 10 1 auto;
190 background-color: rgba(156,156,156,0.3);
191 overflow: auto;
192 resize: vertical;
 
 
 
193 }
194 #chat-input-field:empty::before {
195 content: attr(data-placeholder);
196 opacity: 0.6;
197 }
198
--- src/style.chat.css
+++ src/style.chat.css
@@ -188,10 +188,13 @@
188 padding: 0.2em;
189 flex: 10 1 auto;
190 background-color: rgba(156,156,156,0.3);
191 overflow: auto;
192 resize: vertical;
193 white-space: pre-wrap;
194 /* ^^^ Firefox, when pasting plain text into a contenteditable field,
195 loses all newlines unless we explicitly set this. Chrome does not. */
196 }
197 #chat-input-field:empty::before {
198 content: attr(data-placeholder);
199 opacity: 0.6;
200 }
201

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button