Defaulting Y.ButtonCore's template to type=button (#973, #968) #1296

Open
wants to merge 1 commit into
from

1 participant

@derek

As issue #968 mentions, any Buttons rendered without a host/srcNode config option will default to type=submit. This is the correct behavior for any <button> element without a type attribute (spec), however, in the context of Y.Button, that is certainly not the ideal default. It is much more likely that someone would like to listen in on a click events instead of submit the parent form. So this change updates the default TEMPLATE to include type=button.

If the intent actually is to have type=submit, the implementer can either override Y.ButtonCore.prototype.TEMPLATE, or specify it in a new Y.Node instance in the config (as a new test does).

✓ Testing started on Firefox (24.0) / Mac OS, Chrome (30.0.1599.69) / Mac OS, Safari (6.0.5) / Mac OS, Safari (4.0) / Linux, Safari (4.0) / Linux, Safari (7.0) / iOS 7.0.2
✓ Agent completed: Safari (6.0.5) / Mac OS
✓ Agent completed: Chrome (30.0.1599.69) / Mac OS
✓ Agent completed: Firefox (24.0) / Mac OS
✓ Agent completed: Safari (4.0) / Android 2.3
✓ Agent completed: Safari (7.0) / iOS 7.0.2
✓ Agent completed: Safari (4.0) / Android 4
✓ Agent completed: Internet Explorer (9.0) / Windows 7
✓ Agent completed: Internet Explorer (10.0) / Windows 8
✓ Agent completed: Internet Explorer (8.0) / Windows XP
✓ Agent completed: Internet Explorer (7.0) / Windows XP
✓ Agent completed: Internet Explorer (6.0) / Windows XP
✓ 539 tests passed! (1 minutes, 14 seconds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment