From 052badf03695a16390188efcc4b115ccb3346b13 Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Thu, 6 Oct 2022 16:56:50 -0400 Subject: [PATCH] Fix changing category props not changing after first mount [Fix #685] --- packages/emoji-mart/src/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/emoji-mart/src/config.js b/packages/emoji-mart/src/config.js index 871fc3c5a..f5f16d591 100644 --- a/packages/emoji-mart/src/config.js +++ b/packages/emoji-mart/src/config.js @@ -75,6 +75,8 @@ async function _init(props) { emoji.aliases || (emoji.aliases = []) emoji.aliases.push(alias) } + + Data.originalCategories = Data.categories } else { Data.categories = Data.categories.filter((c) => { const isCustom = !!c.name @@ -116,7 +118,7 @@ async function _init(props) { } if (props.categories) { - Data.categories = Data.categories + Data.categories = Data.originalCategories .filter((c) => { return props.categories.indexOf(c.id) != -1 })