From 38c0856c203d68adbfe8d27f8d5002314f64633b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 28 Dec 2024 16:43:49 +0200 Subject: [PATCH] default values --- src/components/emoji_picker/emoji_picker.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 9f415f79..05529187 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -143,11 +143,11 @@ const EmojiPicker = { const fontSize = css.getPropertyValue('font-size') const emojiSize = css.getPropertyValue('--emojiSize') - const fontSizeUnit = fontSize.replace(/[0-9,.]+/, '') - const fontSizeValue = Number(fontSize.replace(/[^0-9,.]+/, '')) + const fontSizeUnit = fontSize.replace(/[0-9,.]+/, '') || 'px' + const fontSizeValue = Number(fontSize.replace(/[^0-9,.]+/, '')) || 14 - const emojiSizeUnit = emojiSize.replace(/[0-9,.]+/, '') - const emojiSizeValue = Number(emojiSize.replace(/[^0-9,.]+/, '')) + const emojiSizeUnit = emojiSize.replace(/[0-9,.]+/, '') || 'rem' + const emojiSizeValue = Number(emojiSize.replace(/[^0-9,.]+/, '')) || 2.2 let fontSizeMultiplier if (fontSizeUnit.endsWith('em')) { @@ -155,8 +155,6 @@ const EmojiPicker = { } else { fontSizeMultiplier = fontSizeValue / 14 } - console.log('Multiplier', fontSizeMultiplier) - console.log('Result', fontSizeMultiplier * 14) let emojiSizeReal if (emojiSizeUnit.endsWith('em')) {