Why do we have setEnabled for HTML components such as div, a, span etc? It produces semantically incorrect HTML.
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled
The disabled attribute is supported by
<button>,<command>,<fieldset>,<keygen>,<optgroup>,<option>,<select>,<textarea>and<input>.
They may have children that support disabled attribute and setEnabled enables/disables those children. This is a convenient feature.
It's a good point that we could consider to not add the attribute even though we would still mark the element as disabled in our own internal bookkeeping.
Technically, this would mean that Component.onEnabledStateChanged(boolean) could be updated to be more selective, though I'm not sure exactly what would be a good default there since we also need to take into account custom elements and the fact that application themes may have CSS selectors such as div[disabled].foobar.
One important question here is that does adding disabled attribute to e.g. div harm in any way?
See this comment: https://github.com/vaadin/flow/issues/7340#issuecomment-573672228
Most helpful comment
It's a good point that we could consider to not add the attribute even though we would still mark the element as disabled in our own internal bookkeeping.
Technically, this would mean that
Component.onEnabledStateChanged(boolean)could be updated to be more selective, though I'm not sure exactly what would be a good default there since we also need to take into account custom elements and the fact that application themes may have CSS selectors such asdiv[disabled].foobar.