Conversation
|
|
||
| toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE) | ||
| toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW) | ||
| outerElem.setAttribute('aria-expanded', open) |
There was a problem hiding this comment.
I suppose this, will break dropdown functionality (either way it has to be removed in next major version)
There was a problem hiding this comment.
Oups, haven't seen that change, reverting it for sure !
|
can you explain what you're actually trying to achieve here, @louismaximepiton ? what's the current problem, and how does your PR resolve that problem? |
|
Hi Patrick, I'm trying to achieve a side navigation (heavily draft) using the tab js. It works well until I change the role from |
I'm not 100% convinced that particular UI widget is best suited to be represented as a tabbed interface, rather than a set of accordions/menus/megamenus ? do you have a working "after" example that shows the behaviour or your specific case/example with your changes applied? unless i'm mistaken, you're basically trying to hijack the tabs behaviour for non-tabs, and bumping against the guardrails that try to make sure this code only runs on a tabbed interface? looking over the code change, you'll achieve the effect visually, but the currently selected/expanded/live "menuitem"/"tab" also won't programmatically expose that it's expanded/open, which is doesn't sound good from an accessibility point of view... |
I was trying to achieve it only using the Bootstrap bundle but yeah it's far from ideal right now. Haven't thought about using the megamenus since those weren't in Bootstrap bundle but yeah I could try to implement it like that 🤔
Not yet but I could maybe give it a try.
Yes you're right, I'm trying to hack a bit the component here and it doesn't update well the aria attributes. The main issue for me here that it seems we allow people to use several ways to make a working tab: const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`But only one way keep the behavior so I was a bit surprised. I can see two ways to resolve this issue:
|
|
Closing this since it doesn't seem to land in anyway. |
Description
Do the tabindex trick before checking whether the element has the
role="tab"or not.Motivation & Context
I couldn't spot any breaking change.
I tried to change the
roleof the tab component to make it amenubarbut I went into the following issue following those steps:TabandShift + Tabworks well 🟢→,TabandShift + Tabworks but not as expected 🟡→,→,TabandShift + Tabdoesn't work at all 🔴Is there a need for
role="tablist/tab"to make it work/accessible ? If yes, why the behavior still works if I stay on the tabs element ?Here is the Codepen I used to make some tests:
https://codepen.io/louismaximepiton/pen/oNqOEWG
Type of changes
Checklist
npm run lint)Live previews
Related issues
Might be linked to #33079.