a8cteam51 / special-projects-blocks-monorepo

MIT License
8 stars 1 forks source link

Tabs Block #15

Open dhanson-wp opened 4 months ago

dhanson-wp commented 4 months ago

See https://github.com/WordPress/gutenberg/issues/34079.

A block that allows users to organize content into tabs. I’m not sure about all the UX yet (the relationship between the actual tab element and its content is tricky to get right in the editor), but it could be a good starting point.

tabs

gziolo commented 4 months ago

I wrapped up the week-long exploration of the Tabs block. I shared where I left in https://github.com/a8cteam51/special-projects-blocks-monorepo/pull/12#issuecomment-2238997046. I recreated the Example of Tabs with Automatic Activation from ARIA Authoring Practices Guide (APG). This is how it looks in action:

https://github.com/user-attachments/assets/8936fd42-126b-4b0c-8741-a4b955431841

I discussed some of the design choices more in-depth with @jarekmorawski in the issue created in the Gutenberg repository:

@creativecoder is experimenting now with how the Tabs block could get implemented in the Gutenberg plugin:

ahmad-aziz-web commented 3 months ago

@gziolo I have came across your tabs block, the issue arises when we use multiple tabs blocks in same page then switching between tabs items of second tabs block changes the panel of the first tabs block.

gziolo commented 3 months ago

@gziolo I have came across your tabs block, the issue arises when we use multiple tabs blocks in same page then switching between tabs items of second tabs block changes the panel of the first tabs block.

Yes, that's a known issue, as I didn't finish the implementation. The IDs generated for the tab elements aren't unique between different instances on the same page. The work continues in the Gutenberg repository:

I quickly skimmed the code, and it might suffer from the same issue.