davidtheclark / react-aria-tabpanel

A fully accessible, extravagantly flexible, React-powered Tab Panel component

Home Page:http://davidtheclark.github.io/react-aria-tabpanel/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for dynamic tabs?

sgilligan opened this issue · comments

Hi @davidtheclark, does this support dynamically modifying tabs? I'm running into unpredictable behaviour and I'm not sure if because of how I'm doing this (I have a use-case where the number of tabs can vary dynamically).

I've created a test showing my problem based on the stateless example here: https://esnextb.in/?gist=9e389ce9ef672543348eb7fa4d0a774b

Without reducing the tab count, the arrow keys work as expected. If you then reduce the tab count, the arrow nav works one direction, but not the other. If you then restore the tab count, and then reduce once again, the arrow navigation stops working completely (tested Chrome, Windows and OSX)

@sgilligan The module does not currently support this, because of the way arrow keys are managed. There's a list of elements that arrows cycle through, a focus-group; and that list would need to be updated when you remove & add new tabs.

ok .. thanks for the prompt reply.

@sgilligan If you can think of a good API for this, you're welcome to open a PR!