Fossil SCM
/chat another CSS-side contenteditable portability workaround to keep Firefox from losing newlines on pasted-in text.
Commit
c7fa9f150f5a9c0986e8a4b5aa713e1d5da6c1a3062d713be00b447588bcc007
Parent
3cd13cb633e6aa6…
1 file changed
+3
+3
| --- src/style.chat.css | ||
| +++ src/style.chat.css | ||
| @@ -188,10 +188,13 @@ | ||
| 188 | 188 | padding: 0.2em; |
| 189 | 189 | flex: 10 1 auto; |
| 190 | 190 | background-color: rgba(156,156,156,0.3); |
| 191 | 191 | overflow: auto; |
| 192 | 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. */ | |
| 193 | 196 | } |
| 194 | 197 | #chat-input-field:empty::before { |
| 195 | 198 | content: attr(data-placeholder); |
| 196 | 199 | opacity: 0.6; |
| 197 | 200 | } |
| 198 | 201 |
| --- 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 |