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

Dropdown menus submit form #18

Open
diegonc opened this issue Aug 30, 2016 · 6 comments
Open

Dropdown menus submit form #18

diegonc opened this issue Aug 30, 2016 · 6 comments

Comments

@diegonc
Copy link

diegonc commented Aug 30, 2016

Dropdown menus in the toolbar are implemented as button tags but have no type property. The default value for that property is submit which means each time one toolbar menu is opened the form containing the materialnote editor is submitted.

Please add type="button" to the attribute list of buttons. Otherwise, the editor is not very useful when insede a form element.

I'm working with the Meteor package, inside an autoform form, but that should not be relevant.

@AbdelMounhim
Copy link

Hi,

workaround for me (prevent every dropdown to submit)

in the Template.xxx.onRendered :
// all i are buttons ...
$("i").attr("type", "button").click(function(e) { e.preventDefault() });

and in Template.xxx.events :

'click .note-editor * ' : function(e) {
e.preventDefault() ;
return ;
}

@diegonc
Copy link
Author

diegonc commented Sep 6, 2016

AbdelMounhim, the type attribute makes no sense in the context of i HTML elements.

What I temporarily did is:

$(".note-editor")
  .find("button")
  .attr("type", "button");

@Dmitrev
Copy link

Dmitrev commented Sep 16, 2016

@diegonc Thanks, this workaround works great for the time being.

@AbdelMounhim
Copy link

yes. thanks @diegonc for your workaround.

@M-Blobby
Copy link

Same problem.
Thank you @diegonc , your solution works like a charm.

@sergiocasao
Copy link

Lot of thanks @diegonc !

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

5 participants