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 inside paper-form: form is sent and closed when adding new tag (press Enter) #1177

Open
alexander-e1off opened this issue Dec 24, 2020 · 0 comments

Comments

@alexander-e1off
Copy link

ember-paper version 1.0.0-beta.35.

When use chips inside a form:

<PaperForm @onSubmit={{action "basicSubmitAction"}} as |form|>
  ...
 
 <PaperChips @content={{this.content}}  @removeItem={{action "removeItem"}} @addItem={{action "addItem"}} @placeholder="Add a tag" />

  <div class="layout-row">
    <form.submit-button @raised={{true}} @primary={{true}}>Submit</form.submit-button>
  </div>
</PaperForm>

After entering new tag and pressing Enter button, form is sent and closed.

It is expected behavior for other components, e.g. input, but for chips I expect that new tag is added and form is not closed.

As a simple workaround I wrapped chips into div:

<div onkeydown="if (event.keyCode == 13) {return false;}">
  <PaperChips @content={{this.content}}  @removeItem={{action "removeItem"}} @addItem={{action "addItem"}} @placeholder="Add a tag" />
</div>

Is there better solution to solve this issue?

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