Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix previousInclude and previousExclude checks. #4

Merged
merged 1 commit into from
Jul 4, 2017
Merged

Fix previousInclude and previousExclude checks. #4

merged 1 commit into from
Jul 4, 2017

Conversation

ellisio
Copy link

@ellisio ellisio commented Jul 4, 2017

The current implementation requires you to always define :include AND :exclude for search to work. For example, if you do the following:

<picker
    set="apple"
    :emoji-size="16"
    :per-line="12"
    :exclude="['custom']"
    @click="addEmoji">
</picker>

Then attempt to search, you will receive the following JS error:

vendor.js:11692 Uncaught TypeError: Cannot read property 'sort' of undefined
    at Object.search (vendor.js:11692)
    at VueComponent.onInput (vendor.js:11532)
    at boundFn (vendor.js:93445)
    at HTMLInputElement.invoker (vendor.js:95018)

By doing the following, the error goes away:

<picker
    set="apple"
    :emoji-size="16"
    :per-line="12"
    :include="[]"
    :exclude="['custom']"
    @click="addEmoji">
</picker>

There is no reason to require the developer to have the empty :include just to get searching working. So this fix will break the checks apart for previousInclude and previousExclude to resolve this issue.

@jm-david jm-david merged commit d811d3f into jm-david:master Jul 4, 2017
@jm-david
Copy link
Owner

jm-david commented Jul 4, 2017

Looks great, thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants