eduardolundgren/alloy-ui — pull request #259 by Robert-Frampton (2013-08-23 18:26:44+00:00)
Title: Adding type support for aui-toolbar

Hey @eduardolundgren,

I've been working on upgrading plugins, using the Upgrade Tool that Iliyan is working on. I've ran into an issue a few times and I wanted to suggest a fix for it. I think you and Nate have talked about it a few times. In 2.0.x, when you create an aui-toolbar, it's children are defaulting to type="submit", which obviously causes issues when the toolbar is nested inside of a form. Right now I'm working on upgrading a portlet, and there is a toolbar with around 10 children. Right now the only way to fix them is to add event.preventDefault() to their handlers. But it seems weird that we have to add that method for every single button in the toolbar.

My suggestion is that we add the ability to set the type for the button, and have it default to type="button". That way we don't have so many preventDefault()s. We already have it so that we can set the id, class, label, icon, etc. Why not the type as well? Let me know what you think.

Rob