nico3333fr/van11y-accessible-tab-panel-aria

Refactor suggestion

ffoodd opened this issue · 1 comments

Hi there!

@loicblascos came up with a refactored version of your tabpanel script, aiming to be more readable and modern.

You can find it in a dedicated CodePen for now.

I'm not good enough to explain this in details, but I wanted to share this with you :)

I hope it'll help one day!

Thanks for this refactor. I'm using it on a project.

I had an issue with this.panels = [ ...this.element.children ].filter( el => el.matches( panel.class ) ); which I changed to this.element.querySelectorAll( panel.class ); to look for all of the panels that are a child of the Tab container. Works for me!