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

18
src/scss/style.scss

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

Loading…
Cancel
Save