mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 16:58:47 +01:00
Don't add space if empty string
This commit is contained in:
parent
9cc590be1b
commit
0c45f515f0
1 changed files with 5 additions and 3 deletions
|
@ -1398,9 +1398,11 @@ function Compose({
|
|||
const { selectionStart, selectionEnd } = textarea;
|
||||
const text = textarea.value;
|
||||
const textBeforeEmoji = text.slice(0, selectionStart);
|
||||
const spaceBeforeEmoji = /[\s\t\n\r]$/.test(textBeforeEmoji)
|
||||
? ''
|
||||
: ' ';
|
||||
const spaceBeforeEmoji = textBeforeEmoji
|
||||
? /[\s\t\n\r]$/.test(textBeforeEmoji)
|
||||
? ''
|
||||
: ' '
|
||||
: '';
|
||||
const textAfterEmoji = text.slice(selectionEnd);
|
||||
const spaceAfterEmoji = /^[\s\t\n\r]/.test(textAfterEmoji)
|
||||
? ''
|
||||
|
|
Loading…
Reference in a new issue