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

paper-chips component throws an error while executing inputFocus action #606

Open
gpluta opened this issue Jan 3, 2017 · 0 comments
Open

Comments

@gpluta
Copy link

gpluta commented Jan 3, 2017

The issue can be reproduced on the demo page containing paper-chips examples.

When we fill any value in the 'Default template' example and focus out of the input and then focus back again, an error is thrown:
Uncaught TypeError: Cannot read property 'close' of undefined

It seems that this statement is not guarded properly: https://github.com/gpluta/ember-paper/blob/master/addon/components/paper-chips.js#L77

the autocomplete param is an object with an 'actions' prop when the inputFocus action is called from the paper-chips-autocomplete component. Otherwise it is a string containing the value enered in the input.

The if () {} condition should contain a check if the actions prop is available on autocomplete parameter. It should look like:

      if (isPresent(autocomplete) && autocomplete.actions) {
        autocomplete.actions.close();
      }

Can I create a PR for this little fix? Am I missing something important?

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

No branches or pull requests

1 participant