materialNote icon indicating copy to clipboard operation
materialNote copied to clipboard

Dropdown menus submit form

Open diegonc opened this issue 8 years ago • 6 comments

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.

diegonc avatar Aug 30 '16 20:08 diegonc

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 ; }

AbdelMounhim avatar Sep 06 '16 18:09 AbdelMounhim

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");

diegonc avatar Sep 06 '16 18:09 diegonc

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

Dmitrev avatar Sep 16 '16 10:09 Dmitrev

yes. thanks @diegonc for your workaround.

AbdelMounhim avatar Sep 16 '16 10:09 AbdelMounhim

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

M-Blobby avatar Nov 16 '16 15:11 M-Blobby

Lot of thanks @diegonc !

sergiocasao avatar Dec 20 '16 15:12 sergiocasao