ionic-team / ionic-team/ionic-framework

feat: Configurable Tab History Behavior

Offen
#31,238 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
triage
Vorherrschende Sprache
TypeScript
Sterne
52.7k
Forks
13.3k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
51

Beschreibung

### Prerequisites

- [x] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [x] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [x] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already include this feature request, without success.

### Describe the Feature Request

Currently, every IonTabButton press is added to the history stack. Repeatedly switching between tabs results in back navigation replaying every tab switch:

Practice → Patterns → Progress → Patterns → Progress

Back:

Progress ← Patterns ← Progress ← Patterns ← Practice

Would it be possible to support a configurable tab history mode (e.g. all, unique, or isolated) so developers can achieve navigation behavior similar to apps like Reddit, Instagram, or YouTube?

Ideally, repeated visits to the same tab would not create duplicate history entries.

### Describe the Use Case

`IonTabs` currently adds every tab switch to the history stack. Repeatedly switching between tabs causes the Android back button to replay every tab selection, leading to a ping-pong effect between tabs. This can feel unintuitive for apps that prefer Reddit/Instagram-style navigation.

### Describe Preferred Solution

Add an optional tab history mode that prevents duplicate tab visits from being added to the history stack. For example, after:

`Practice → Patterns → Progress → Patterns → Progress`

pressing Back could navigate:

`Progress ← Patterns ← Practice`

instead of replaying every tab switch.

### Describe Alternatives

_No response_

### Related Code

_No response_

### Additional Information

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with the IonTabs and IonTabButton navigation behavior described in the issue, then trace how tab presses enter the history stack. Clarify the semantics of the proposed all, unique, and isolated modes before changing behavior; done means the selected mode is configurable and repeated tab visits produce the expected Back navigation.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
frontend, mobile
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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