Comments (5)
Ah I see, that makes sense. It looks like the @Method
decorator was accidentally removed from getLength
: 1d46973#diff-4b2ac275268173207c99a590b0ced8b67dc3d697815eb51a3c0546ee7cb0c0aeR429-L445
I'll put up a PR to fix this.
from ionic-framework.
Hey there,
Can you clarify the bug report? getLength
is not a public API, so it should not be part of the public type interfaces.
from ionic-framework.
Sure! So I use this in in order to call public APIs, such as removeIndex
. I use this to remove the previous navigation page from the stack. Without knowing how long the current stack is I am not sure how to call removeIndex
.
A lot of the public APIs for ion-nav
rely on index
.
If there is a public API for determining the length of the stack in order to call removeIndex
please let me know :)
A practical example is after a user has signed up, I want to remove previous intermediate signup pages from the stack (since the user should not be able to navigate back). Example code:
nav.push(
() => <Joined verifyEmailSent={verify_email_sent} />,
null,
null,
async (hasCompleted, requiresTransition, entering) => {
// Remove signup steps from stack (everything between root and current nav view)
// (user should not be able to navigate back after signup)
// TODO open bug for missing ionic type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (entering) nav.removeIndex(1, (nav as any).getLength() - 2);
},
);
from ionic-framework.
Thanks for the issue. This has been resolved via #28832, and a fix will be available in an upcoming release of Ionic Framework. By marking getLength
as a public method I also needed to make it return Promise<number>
instead of number
. Since this API was technically part of the public API (even though it's hard to use as-is right now), we are considering this a breaking change to minimize disruptions to existing apps. This fix will be available in the next major release of Ionic.
from ionic-framework.
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.
from ionic-framework.
Related Issues (20)
- bug: ion-item slot end is shifted to the left HOT 5
- bug: item-sliding removes its border when there is an item in the list after it in an inset list
- bug: Refresher Content's icon on IOS won't show up properly unless the refresh's processing
- bug: datetime should clamp within the min/max when the min or max changes HOT 1
- bug: ion-item with ion-input firing 2 click events on iPhoneX HOT 1
- bug: IonModal focus trap does not allow other components to overlay HOT 2
- feat: localization calendar (`ion-datetime`) HOT 2
- bug: test
- feat: test
- feat: Ability to reorder horizontally in `ion-reorder ` HOT 3
- Ionic 7 Angular Standalone Component (Sidebar Menu Toggle not working in android device) HOT 2
- bug: IonInput has no placeholder text when type="time" HOT 4
- bug: Alert button handlers are executed outside the angular zone in certain cases HOT 3
- bug: input blurring utility causes non input and textarea elements to be blurred HOT 3
- bug: IonAert button get empty value from input HOT 3
- bug: ion-textarea Text Selection Not Persisting on Safari HOT 4
- bug: ion-toggle focus-visible doesnt work HOT 4
- IOS 17.4 will stop supporting PWA for Europe HOT 1
- feat: Webhook test - ignore HOT 1
- bug: item-sliding animation jumps when using multi touch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-framework.