emmet icon indicating copy to clipboard operation
emmet copied to clipboard

Button element default type

Open NYKOL4Z opened this issue 2 years ago • 2 comments

Maybe I'm missing something, but according to MDN the default type for a button element is "submit".

Considering that, there should be a way of creating a button of type button, but according to emmet's documentation, there isn't.

So, as you can use button:submit, button:s and btn:s to create a <button type="submit"></button>, you should also be able to use button:button, button:b and btn:b to create a <button type="button"></button>.

NYKOL4Z avatar Jan 27 '22 13:01 NYKOL4Z

I knew I would find this ticket :)

Agree 100% on that. Given that we have button expanding to <button> (which by browser is understood as type="submit"), and we also have button:submit expanding to same thing, it duplication.

I would vote to either change the default (meaning, to have bare button expand to <button type="button">, or to introduce a new shortcut to get that markup.

The former solution sounds more reasonable to me as it produces markup that is safe.

moniuch avatar Oct 10 '22 10:10 moniuch

A PR for this has been merged so the issue should be resolved

JayWright31 avatar May 02 '23 08:05 JayWright31