Fix calculateAuthorWidth for emojis (#1130)

This commit is contained in:
Alexander Zinchuk 2021-05-31 17:22:56 +03:00
parent bfdcf6d9b0
commit bf4ff6355a

View File

@ -3,7 +3,7 @@ let element: HTMLSpanElement | undefined;
export default function calculateAuthorWidth(text: string) {
if (!element) {
element = document.createElement('span');
element.style.font = '400 12px Roboto, "Helvetica Neue", sans-serif';
element.style.font = '400 12px Roboto, "Helvetica Neue", "Apple Color Emoji", sans-serif';
element.style.whiteSpace = 'nowrap';
element.style.position = 'absolute';
element.style.left = '-999px';