Skip to content
Commit 684386d4 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska 2️⃣
Browse files

feat(GlDisclosureDropdown): wrap custom item content in `button` or `link`

Previously when `list-item` slot was used, it
wrapped content into styled `span`s but user had
to render button or link themselves. Thus to overwrite
those elements styles and set the `tabindex`.
It proved to be a poor DevX.
With this change the content provided to the `list-item`
slot will automatically be wrapped in a styled button or link
with a correct `tabindex`.
Button or link will be decided based on the provided `item` prop.
If it has `href` prop - then the link is rendered. Button otherwise.
When totally  custom content is needed,
it can be provided to the `default` slot
of the `GlDisclosureDropdownItem`.

BREAKING CHANGE: It will cause styling and semantic issues
in the downstream project.
Wherever the `list-item` slot is used with a `button` or `a` inside
it wrapping the content, this wrapper `button/a` needs to be removed.
parent 40dd837a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment