Use lowercase category names in include/exclude [Ref #53]

release
Etienne Lemay 2017-04-04 11:56:08 -04:00
parent 23cd1ea550
commit bb538ff9a3
2 changed files with 4 additions and 4 deletions

View File

@ -23,8 +23,8 @@ import { Picker } from 'emoji-mart'
| **autoFocus** | | `false` | Auto focus the search input when mounted |
| **color** | | `#ae65c5` | The top bar anchors select and hover color |
| **emoji** | | `department_store` | The emoji shown when no emojis are hovered |
| **include** | | `['People', 'Flags']` | Only load included categories |
| **exclude** | | `['Animals', 'Objects']` | Don't load excluded catagories |
| **include** | | `[]` | Only load included categories. Accepts [I18n categories keys](#i18n). |
| **exclude** | | `[]` | Don't load excluded categories. Accepts [I18n categories keys](#i18n). |
| **emojiSize** | | `24` | The emoji width and height |
| **onClick** | | | Params: `(emoji, event) => {}` |
| **perLine** | | `9` | Number of emojis per line. While theres no minimum or maximum, this will affect the pickers width. This will set *Frequently Used* length as well (`perLine * 4`) |

View File

@ -43,8 +43,8 @@ export default class Picker extends React.Component {
let filteredCategories = [];
for (let hash of data.categories) {
let isIncluded = props.include == undefined ? true : props.include.indexOf(hash.name) > -1
let isExcluded = props.exclude == undefined ? false : props.exclude.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.toLowerCase()) > -1
if (!isIncluded || isExcluded) { continue; }
let new_emojis = [];