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

Second Button or IconButton fires submit event #953

Closed
carlitux opened this issue Nov 11, 2016 · 6 comments
Closed

Second Button or IconButton fires submit event #953

carlitux opened this issue Nov 11, 2016 · 6 comments

Comments

@carlitux
Copy link

carlitux commented Nov 11, 2016

I have one Button with type submit and I created another Button/IconButton (I tested both) clicking on this fires the submit event on form.

EDIT: And if I add the onClick on the second button all input fields call this callback

@carlitux
Copy link
Author

carlitux commented Nov 11, 2016

Changing onClick to onMouseUp fix the second error, now callback is only called when click on button.

But still on clicking it fires the on submit form event.

BTW.- Maybe a bad reference on event delegation?

@javivelasco
Copy link
Member

I guess it was happening because by default if the button has no type it seems like it submits the form if it's contained in it. I've added a default type="button" by default to Button when it has no href and therefore it's a button element.

@carlitux
Copy link
Author

Thank you

alexi21 added a commit to EventHubAU/react-toolbox that referenced this issue Dec 6, 2016
* dev: (285 commits)
  Fixes react-toolbox#1016
  Enable theming of Input component inside Dropdown component. Related to react-toolbox#877 and react-toolbox#920 and commit #d0a9032
  Make Tooltip use currentTarget instead of target when calculating the position
  Allow Tooltip factory to use string native components
  Make chips avatar detection work when decorated
  Release 1.3.1
  Fixes react-toolbox#1007
  Fixes react-toolbox#1001
  Dropdown auto fix
  Fixes react-toolbox#236
  Fixes react-toolbox#964
  Fixes react-toolbox#999
  Release 1.3.0
  Add tooltipShowOnClick to README
  add required attribute to DropdownProps interface
  Extend extensions
  Pass event to selection.
  Fix react-toolbox#939
  Fix react-toolbox#409
  Fix react-toolbox#953
  ...

# Conflicts:
#	components/autocomplete/Autocomplete.js
#	lib/autocomplete/Autocomplete.js
#	lib/button/Button.js
#	lib/button/IconButton.js
#	lib/checkbox/Checkbox.js
#	lib/date_picker/Calendar.js
#	lib/date_picker/CalendarDay.js
#	lib/date_picker/CalendarMonth.js
#	lib/date_picker/DatePicker.js
#	lib/date_picker/DatePickerDialog.js
#	lib/dropdown/Dropdown.js
#	lib/form/Form.js
#	lib/hoc/ActivableRenderer.js
#	lib/hoc/Portal.js
#	lib/input/Input.js
#	lib/list/List.js
#	lib/list/ListItem.js
#	lib/list/ListItemContent.js
#	lib/menu/IconMenu.js
#	lib/menu/Menu.js
#	lib/menu/MenuItem.js
#	lib/overlay/Overlay.js
#	lib/progress_bar/ProgressBar.js
#	lib/radio/RadioButton.js
#	lib/radio/RadioGroup.js
#	lib/ripple/Ripple.js
#	lib/slider/Slider.js
#	lib/snackbar/Snackbar.js
#	lib/switch/Switch.js
#	lib/table/Table.js
#	lib/table/TableRow.js
#	lib/tabs/Tab.js
#	lib/tabs/TabContent.js
#	lib/tabs/Tabs.js
#	lib/tabs/__tests__/index.spec.js
#	lib/time_picker/Clock.js
#	lib/time_picker/ClockFace.js
#	lib/time_picker/ClockHand.js
#	lib/time_picker/ClockHours.js
#	lib/time_picker/ClockMinutes.js
#	lib/time_picker/TimePicker.js
#	lib/time_picker/TimePickerDialog.js
#	lib/tooltip/Tooltip.js
@drager
Copy link
Contributor

drager commented Dec 15, 2016

@javivelasco: This broke our application since all our buttons in a form is no longer of type submit. I do not get why this wasn't a major release.

@javivelasco
Copy link
Member

Sorry about it @drager I never thought it would create an issue since having a submit button usually means adding the type=submit. I will try to get clean changelogs from the next release.

@drager
Copy link
Contributor

drager commented Dec 19, 2016

@javivelasco: Great! Thanks for a great project.

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

3 participants