Refactor suggestion
ffoodd opened this issue · 1 comments
ffoodd commented
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!
kingkool68 commented
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!