bem / bem-components

Set of components for sites development
https://bem.info/libraries/classic/bem-components/6.0.0/
Other
333 stars 87 forks source link

button: wrong definition of real button #1566

Closed sipayRT closed 9 years ago

sipayRT commented 9 years ago

Now in templates we check just type modifier:

var modType = ctx.mod('type'),
      isRealButton = !modType || modType === 'submit';

But if we will change in BEMJSON tag, for example, to <div>, variable isRealButton still will be true. It's wrong because we can't add some attributes such as disabled to <div>.

In the attach block it's very important because we use <span> tag instead of <button>. As a result — disabled button in attach block will be disabled only visually for a11y's programs.

sipayRT commented 9 years ago

@veged @dfilatov @narqo @tadatuta @aristov Are we really need to keep in mind the possibility of changing the tag? Or we shouldn't support it?

tadatuta commented 9 years ago

as we already use different tag in attach I suggest to add the check for tag to isRealButton condition as well