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 issue #2 - SC.Buttons inside of form tags trigger form submission #3

Closed
wants to merge 2 commits into from

Conversation

ebryn
Copy link
Member

@ebryn ebryn commented May 26, 2011

Pretty simple fix.

@mgood
Copy link
Contributor

mgood commented May 31, 2011

What about setting the button "type" attribute to "button", instead of the default of "submit"? Returning false from mouseUp does stop the form submission, but it seems like there's also a chance it would stop the event handling chain too early and prevent other event handlers from being called. Setting the "type" to "button" will make it not submit the form without affecting other event handling.

@wycats
Copy link
Member

wycats commented Jun 1, 2011

Hey ebryn,

What's the reason your button is inside a form tag, and is of type "submit" vs. "button"?

@ebryn
Copy link
Member Author

ebryn commented Jun 1, 2011

It's being used inside an existing app, within an HTML form tag. SC isn't being used for data submission, the form tag is.

I'm not explicitly setting the type of the button, I'm just using the standard SC.Button view. After doing a little research, it looks like the button tag defaults to a type of submit if it's not specified. Looking at the SC.Button source, it doesn't look like setting the type attribute is currently possible - perhaps it could be modified to support setting it?

@ebryn ebryn closed this Jun 2, 2011
@ebryn
Copy link
Member Author

ebryn commented Jun 2, 2011

Closed since my original solution isn't the best approach.

rwjblue pushed a commit to rwjblue/ember.js that referenced this pull request Nov 4, 2014
Use updated HTMLBars to vendor simple-html-tokenizer.
nickiaconis added a commit to nickiaconis/ember.js that referenced this pull request Jun 1, 2016
locks added a commit that referenced this pull request Aug 16, 2017
# This is the 1st commit message:
typo in comment

# The commit message #2 will be skipped:

#	indent yuidoc comment

# The commit message #3 will be skipped:

#	remove IE8 test

# The commit message #4 will be skipped:

#	remove commented out test

# The commit message #5 will be skipped:

#	use file path and add imports
#
#	Used RFC #176 modules API for imports.
#	Also cleaned up some of the globals-mode usage.

# The commit message #6 will be skipped:

#	clean up more globals style documentation

# The commit message #7 will be skipped:

#	Updates blueprints

# The commit message #8 will be skipped:

#	remove extra type check

# The commit message #9 will be skipped:

#	[BUGFIX beta] Reusing element causes problems in Safari
#
#	When testing allowed input types, in some versions of Safari the type
#	cannot be change to `file` if previously set to a different one.
#
#	Fixes #14727

# The commit message #10 will be skipped:

#	[DOC release]missed code block added

# The commit message #1 will be skipped:

#	[DOC release] Update wait.js - Add missing backticks to code snippet.

# The commit message #2 will be skipped:

#	use safe `toString` for array content in `mixins/array`

# The commit message #3 will be skipped:

#	avoid expanding already expanded property key in computed.sort

# The commit message #4 will be skipped:

#	avoid expanding already expanded property key in reduceMacro/arrayMacro/multiArrayMacro

# The commit message #5 will be skipped:

#	[DOC release] Make `Ember.expandProperties` public

# The commit message #6 will be skipped:

#	reuse meta `arrayContentDidChange`

# The commit message #7 will be skipped:

#	replace `throw` with assertion in `enumerable`

# The commit message #8 will be skipped:

#	[BUGFIX beta] Allow boolean values for current-when
#
#	As the docs say, `A link will be active if current-when is true`.
#	Looks like this might have been broken since 1.13 and #12344
#	did not seem to actually fix this particular bug.
#
#	Related issues:
#
#	- #12512
#	- #12630 (fix was not merged)
#	- #12296

# The commit message #9 will be skipped:

#	remove unused imports

# The commit message #10 will be skipped:

#	[DOC] Improve Ember.isEmpty

# The commit message #1 will be skipped:

#	micro optimization in `enumerable`
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.

3 participants