From 4fda4dcc01e4f232c31b2a990d4a6c83f21ed6be Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Thu, 28 Mar 2019 08:30:18 -0400 Subject: [PATCH 1/3] fix: use span for non-clickable emojis --- src/components/emoji/nimble-emoji.js | 21 +++++++++++++++++---- src/utils/shared-default-props.js | 3 --- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/components/emoji/nimble-emoji.js b/src/components/emoji/nimble-emoji.js index 13f6017..0991d86 100644 --- a/src/components/emoji/nimble-emoji.js +++ b/src/components/emoji/nimble-emoji.js @@ -177,23 +177,36 @@ const NimbleEmoji = (props) => { } } + var Tag = { + name: 'span', + props: {}, + } + + if (props.onClick) { + Tag.name = 'button' + Tag.props = { + type: 'button' + } + } + if (props.html) { style = _convertStyleToCSS(style) - return `` + } class='${className}'>${children || ''}` } else { return ( - + ) } } diff --git a/src/utils/shared-default-props.js b/src/utils/shared-default-props.js index 489869b..0517746 100644 --- a/src/utils/shared-default-props.js +++ b/src/utils/shared-default-props.js @@ -9,9 +9,6 @@ const EmojiDefaultProps = { tooltip: false, backgroundImageFn: (set, sheetSize) => `https://unpkg.com/emoji-datasource-${set}@${EMOJI_DATASOURCE_VERSION}/img/${set}/sheets-256/${sheetSize}.png`, - onOver: () => {}, - onLeave: () => {}, - onClick: () => {}, } const PickerDefaultProps = { From 32282a6dc74721ad018263fff7098f228b8e8abc Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Thu, 28 Mar 2019 09:14:25 -0400 Subject: [PATCH 2/3] Fix prettier --- src/components/emoji/nimble-emoji.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/emoji/nimble-emoji.js b/src/components/emoji/nimble-emoji.js index 0991d86..ddabe1d 100644 --- a/src/components/emoji/nimble-emoji.js +++ b/src/components/emoji/nimble-emoji.js @@ -185,7 +185,7 @@ const NimbleEmoji = (props) => { if (props.onClick) { Tag.name = 'button' Tag.props = { - type: 'button' + type: 'button', } } From 7f05e22d1262e58b19797c2695e33a19704dcf50 Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Thu, 28 Mar 2019 09:16:43 -0400 Subject: [PATCH 3/3] Fix test --- src/components/__tests__/__snapshots__/not-found.test.js.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/__tests__/__snapshots__/not-found.test.js.snap b/src/components/__tests__/__snapshots__/not-found.test.js.snap index b1d0335..979d528 100644 --- a/src/components/__tests__/__snapshots__/not-found.test.js.snap +++ b/src/components/__tests__/__snapshots__/not-found.test.js.snap @@ -4,7 +4,7 @@ exports[`Renders component 1`] = `
- +