-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: ion-item-sliding does not respond to item.open()
when inner item has been rendered via ng-template
#26991
Comments
item.open()
when inner item has been rendered via ng-templateitem.open()
when inner item has been rendered async via ng-template
item.open()
when inner item has been rendered async via ng-templateitem.open()
when inner item has been rendered via ng-template
Strangely enough, the following build seems to actually resolve this issue:
Not sure why, but my testing between these versions seems to show that's the case. Looking at the PR, there's nothing that should remotely affect the outcome of ion-item rendering. Is it possible that dev build also had some other changes? This may already be fixed somewhere in dev-land, but I'd love to get confirmation on that! |
Are there nightly builds of V7? |
7.0.0-rc.4 does not resolve this issue. |
Thanks for the report. Here is a dev build if you would like to test the proposed fix:
|
I merged in the fix for this via #27035. I also tested your app with the dev build, and it seems to work. Let me know if you run into any issues with the dev build though. |
Sorry for the delay, @liamdebeasi. It's been a wild day so far. Looks like this is fixed! Thanks so much for the update. |
Screen.Recording.2023-03-28.at.1.09.25.PM.mov |
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. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
When
ion-item-sliding
is rendered asynchronously, and the innerion-item
has been rendered viang-template
composition, sliding items fail to open when callingitem.open()
until they have been manually opened via the gesture.Note that the contents of the sliding item are NOT rendered asyncronously -- This occurs when the
ion-item-sliding
itself is rendered asyncronously, in combination with the use ofng-template
to contain theion-item
inside.Please see the following video, where only items in the first group open on click:
https://user-images.githubusercontent.com/362329/226695190-36cb33d3-7aac-49f0-8f4a-118eab7f7b1e.mov
The issue occurs because
this.item
isnull
whenopen()
is called on the sliding item instances rendered after the initial group. The function returns/aborts and the item is not opened:Expected Behavior
Sliding items should open when
item.open()
is called in this scenario. This use-case is important, because usingng-template
is a core part of Angular template composition and reduction of boilerplate/duplicate code within pages or components, and rendering additional items on a delay (or something like a paginator), is critical for rendering and page-load performance optimization.Steps to Reproduce
Code Reproduction URL
https://github.com/lincolnthree/ionic-issue-item-sliding-open
Ionic Info
Ionic:
Ionic CLI : 6.20.3 (/Users/lincoln/.nvm/versions/node/v16.14.0/lib/node_modules/@ionic/cli)
Ionic Framework : not installed
@angular-devkit/build-angular : 15.2.4
@angular-devkit/schematics : 15.2.4
@angular/cli : 15.2.4
@ionic/angular-toolkit : 8.0.0
Capacitor:
Capacitor CLI : 4.7.1
@capacitor/android : not installed
@capacitor/core : 4.7.1
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.7.2
System:
NodeJS : v16.14.0 (/Users/lincoln/.nvm/versions/node/v16.14.0/bin/node)
npm : 8.3.1
OS : macOS
Additional Information
No response
The text was updated successfully, but these errors were encountered: