Use lowercase category names in include/exclude [Ref #53]
parent
23cd1ea550
commit
bb538ff9a3
|
@ -23,8 +23,8 @@ import { Picker } from 'emoji-mart'
|
||||||
| **autoFocus** | | `false` | Auto focus the search input when mounted |
|
| **autoFocus** | | `false` | Auto focus the search input when mounted |
|
||||||
| **color** | | `#ae65c5` | The top bar anchors select and hover color |
|
| **color** | | `#ae65c5` | The top bar anchors select and hover color |
|
||||||
| **emoji** | | `department_store` | The emoji shown when no emojis are hovered |
|
| **emoji** | | `department_store` | The emoji shown when no emojis are hovered |
|
||||||
| **include** | | `['People', 'Flags']` | Only load included categories |
|
| **include** | | `[]` | Only load included categories. Accepts [I18n categories keys](#i18n). |
|
||||||
| **exclude** | | `['Animals', 'Objects']` | Don't load excluded catagories |
|
| **exclude** | | `[]` | Don't load excluded categories. Accepts [I18n categories keys](#i18n). |
|
||||||
| **emojiSize** | | `24` | The emoji width and height |
|
| **emojiSize** | | `24` | The emoji width and height |
|
||||||
| **onClick** | | | Params: `(emoji, event) => {}` |
|
| **onClick** | | | Params: `(emoji, event) => {}` |
|
||||||
| **perLine** | | `9` | Number of emojis per line. While there’s no minimum or maximum, this will affect the picker’s width. This will set *Frequently Used* length as well (`perLine * 4`) |
|
| **perLine** | | `9` | Number of emojis per line. While there’s no minimum or maximum, this will affect the picker’s width. This will set *Frequently Used* length as well (`perLine * 4`) |
|
||||||
|
|
|
@ -43,8 +43,8 @@ export default class Picker extends React.Component {
|
||||||
let filteredCategories = [];
|
let filteredCategories = [];
|
||||||
|
|
||||||
for (let hash of data.categories) {
|
for (let hash of data.categories) {
|
||||||
let isIncluded = props.include == undefined ? true : props.include.indexOf(hash.name) > -1
|
let isIncluded = props.include == undefined ? true : props.include.indexOf(hash.name.toLowerCase()) > -1
|
||||||
let isExcluded = props.exclude == undefined ? false : props.exclude.indexOf(hash.name) > -1
|
let isExcluded = props.exclude == undefined ? false : props.exclude.indexOf(hash.name.toLowerCase()) > -1
|
||||||
if (!isIncluded || isExcluded) { continue; }
|
if (!isIncluded || isExcluded) { continue; }
|
||||||
|
|
||||||
let new_emojis = [];
|
let new_emojis = [];
|
||||||
|
|
Loading…
Reference in New Issue