Browse Source

Returned [contenteditable] on emoji for input font

master
Eduard Kuzmenko 4 years ago
parent
commit
a7469e3cfe
  1. 4
      src/lib/richtextprocessor.ts
  2. 18
      src/scss/style.scss

4
src/lib/richtextprocessor.ts

@ -512,8 +512,8 @@ namespace RichTextProcessor { @@ -512,8 +512,8 @@ namespace RichTextProcessor {
break;
case 'messageEntityEmoji':
html.push(emojiSupported ? // ! contenteditable="false" было у span, зачем?
`<span class="emoji">${encodeEntities(entityText)}</span>` :
html.push(emojiSupported ? // ! contenteditable="false" нужен для поля ввода, иначе там будет меняться шрифт в Safari
`<span contenteditable="false" class="emoji">${encodeEntities(entityText)}</span>` :
`<img src="assets/img/emoji/${entity.unicode}.png" alt="${encodeEntities(entityText)}" class="emoji">`);
break;

18
src/scss/style.scss

@ -295,7 +295,7 @@ h4 { @@ -295,7 +295,7 @@ h4 {
}
}
input, [contenteditable] {
input, [contenteditable=true] {
caret-color: $button-primary-background;
}
@ -641,18 +641,18 @@ img.emoji { @@ -641,18 +641,18 @@ img.emoji {
}
}
[contenteditable] {
[contenteditable=true] {
user-select: text;
outline: none;
cursor: text;
}
&[data-placeholder] {
&:empty:before {
content: attr(data-placeholder);
color: #a2acb4;
display: block; /* For Firefox By Ariel Flesler */
cursor: text;
}
[contenteditable][data-placeholder] {
&:empty:before {
content: attr(data-placeholder);
color: #a2acb4;
display: block; /* For Firefox By Ariel Flesler */
pointer-events: none;
}
}

Loading…
Cancel
Save