Skip to content

Commit

Permalink
Fix changing category props not changing after first mount [Fix #685]
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Oct 6, 2022
1 parent 3ebbb55 commit 052badf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/emoji-mart/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
})
Expand Down

0 comments on commit 052badf

Please sign in to comment.