ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.02k stars 13.51k forks source link

feat: add routing support to breadcrumbs #23553

Closed EinfachHans closed 2 years ago

EinfachHans commented 3 years ago

Feature Request

Ionic version:

[ ] 4.x [ ] 5.x [X] 6.x

Describe the Feature Request

The default routerDirection on a <ion-breadcrumb> is currently forward. I think it would be better to determinate that on the active Breadcrumb.

Describe Preferred Solution

If a user clicked on a Breadcrumb that is before the currently active one, the router Direction should be backwards, otherwise forward.

liamdebeasi commented 3 years ago

ion-breadcrumb does not make any assumptions about the routing integration and it is up to the user to do that themselves. Do you have a use case for how you are using breadcrumbs right now?

EinfachHans commented 3 years ago

I'm not yet using them, but if v6 is stable and i migrate my app i want to use it of course.

Lets say we have 4 Pages which are routed like this:

Page 1 --> Page 2 --> Page 3 --> Page 4

Starting from Page 2 i would use Breadcrumps on every Page to give the user a better overview about where he is and were he was before, so the Setup would be:

on Page 2: Breadcrumbs: Page1 > Page 2

on Page 3: Breadcrumbs: Page1 > Page 2 > Page 3

on Page 4: Breadcrumbs: Page1 > Page 2 > Page 3 > Page 4

If a user wants to navigate back and does this via the Breadcrumbs he should have the feeling of going back, so if he is on Page 4 and choose to go back to Page 1, it should be a backwards direction. As i don't want to add this to every single breadcrum i think it should be default for breadcrums that are before the active one.

liamdebeasi commented 3 years ago

Thanks for the additional information. I think the bigger request here is to add routing integration to the breadcrumbs. Right now, the team is not really in favor of adding that since we don't have enough information to implement it in a way that would be useful to developers, but I am going to keep this issue open for now.

For others interested in this feature, please reply below with your use case. If you don't have a use case but are still interested in seeing this feature, please add an emoji reaction to the original issue instead of commenting "+1" below. Thanks!

EinfachHans commented 2 years ago

This is done with 6.0.2: #24493

ionitron-bot[bot] commented 2 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.