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

MultiSelect close button type not defined - Can lead to preventing a <form> from submitting #1136

Closed
manstir opened this issue Jan 6, 2020 · 1 comment

Comments

@manstir
Copy link

manstir commented Jan 6, 2020

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Current behavior
given a regular html form with a MultiSelect component from prime:

<form onSubmit={this.handleSubmit}>
  <MultiSelect value={...} options={...} />
  <input type="text" name="regularInput" value={...} onChange={...} />
  <button type="submit">submit</button>
</form>

if the cursor is in the "regularInput" field, the "Enter" Key does not submit the form. "handleSubmit" won't be called.

Issue: the MultiSelect-Header contains a close button: <button... />

<button className="p-multiselect-close p-link" onClick={this.props.onClose}>

but because the type="button" <button type="button"... is missing, it will be type=submit by default.

the form will use the first "submit" button onEnter. hence, the submitbutton at the end of the for wont be executed.

if prime does not relay on the close button in the MultiSelect beeing "type=submit". is sggest you add "type=button"

  • Browser:
    Chrome 79

  • Language:
    ES6

@manstir manstir changed the title MultiSelect close button type not defined - Can lead to preventing a <from> from submitting MultiSelect close button type not defined - Can lead to preventing a <form> from submitting Jan 6, 2020
@mertsincan
Copy link
Member

Duplicate of #1155

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

2 participants