Support hiding of all TabPanels

Offen
#525 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
javascript, react

Rechercherichtung

Beginne damit, nachzuverfolgen, wie react-tabs defaultIndex verarbeitet und wie das Rendern von TabPanel reagiert, wenn kein Tab ausgewählt ist. Lege das Verhalten für defaultIndex={null} fest, einschließlich der Aktivierung nach einer Tab-Auswahl, und decke sowohl den anfänglich leeren Zustand als auch die anschließende Auswahl mit Tests ab.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Firstly, thanks for this great lib. The focus on a11y is a huge +1.

The UI I'm aiming for is a tab-strip with all the tab panels closed, and a tab is activated only when the user selects a tab. It looks like react-tabs doesn't currently support hiding all the tab panels.

I searched the issues here to find #287, but this seems to be using a CSS-only solution. This will still cause the DOM to have the tab panel. This not only adds unnecessary stuff to the DOM (my tab panel could have a lot of DOM nodes), but also fires off the rendering lifecycle of the tab panel's contents, including all the hooks for that panel. In my case, this would trigger network requests and such, which I would like to avoid.

Would it be possible to build support for something like defaultIndex={null}, so that all tab panels can be hidden away until needed?

Vorherrschende Sprache
JavaScript
Sterne
3.1k
Forks
455
Ø Merge
5 Std. 9 Min.
Gemergte PRs (30 T.)
2

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus reactjs/react-tabs

Alle Issues in reactjs/react-tabs

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.