You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The public API for <BsDropdown> is currently confusing.
It yields two components to render the dropdown toogle:
toggle, which renders a <a> element
button, which renders a <button> element
This is problematic for multiple reasons:
Bootstrap documentation recommends using a <button> for the dropdown toogle. A <a> element should be only used in exceptional cases. Due to the current naming, a consumer likely expects that the yielded toggle component should be used by default.
A button can be used in a dropdown menu item. It's likely that a consumer expect that a yielded button component should be used for that. While it only works as dropdown toggle.
Yielding two different components forces the user making an explicit decision if a <button> or <a> element should be used for the toggle. While in nearly all cases a <button> is correct. Ember Bootstrap should simplify mental model for consumers by only yielding one component for the toggle. That component should have an optional argument allowing to render a <a> if needed.
Rendering a <button> instead of a <a> in yielded toggle component is a breaking change. We can only do so in a major release.
I propose the following migration path:
Add an optional as argument to yielded toggle component, which excepts "button" and "a" as arguments. Have it default to "a" in the current major. Switch the default to "button" in the next major.
Deprecate the yielded button component.
As an alternative, we could do both at once in an upcoming major release.
The text was updated successfully, but these errors were encountered:
The public API for
<BsDropdown>
is currently confusing.It yields two components to render the dropdown toogle:
toggle
, which renders a<a>
elementbutton
, which renders a<button>
elementThis is problematic for multiple reasons:
<button>
for the dropdown toogle. A<a>
element should be only used in exceptional cases. Due to the current naming, a consumer likely expects that the yieldedtoggle
component should be used by default.button
component should be used for that. While it only works as dropdown toggle.<button>
or<a>
element should be used for the toggle. While in nearly all cases a<button>
is correct. Ember Bootstrap should simplify mental model for consumers by only yielding one component for the toggle. That component should have an optional argument allowing to render a<a>
if needed.Rendering a
<button>
instead of a<a>
in yieldedtoggle
component is a breaking change. We can only do so in a major release.I propose the following migration path:
as
argument to yieldedtoggle
component, which excepts"button"
and"a"
as arguments. Have it default to"a"
in the current major. Switch the default to"button"
in the next major.button
component.As an alternative, we could do both at once in an upcoming major release.
The text was updated successfully, but these errors were encountered: