mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-02 02:35:20 +08:00
fix(reorder-group): add children fallback for framework compatibility (#30593)
Issue number: resolves #30592 --------- ## What is the current behavior? Reorder group is failing for Angular, React & Vue due to the change from `children` to `__children`. ## What is the new behavior? - Fallback to `children` if `__children` is undefined. - Adds an e2e test for Angular (depends on https://github.com/ionic-team/ionic-framework/pull/30594) - Tasks have been created to migrate and add e2e tests for the other frameworks ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information Dev build: `8.7.2-dev.11754087334.1815cf22` --------- Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
This commit is contained in:
@ -153,7 +153,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
const heights = this.cachedHeights;
|
||||
heights.length = 0;
|
||||
const el = this.el;
|
||||
const children: any = el.__children;
|
||||
const children: any = el.__children || el.children;
|
||||
if (!children || children.length === 0) {
|
||||
return;
|
||||
}
|
||||
@ -259,7 +259,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
private completeReorder(listOrReorder?: boolean | any[]): any {
|
||||
const selectedItemEl = this.selectedItemEl;
|
||||
if (selectedItemEl && this.state === ReorderGroupState.Complete) {
|
||||
const children: any = this.el.__children;
|
||||
const children: any = this.el.__children || this.el.children;
|
||||
const len = children.length;
|
||||
const toIndex = this.lastToIndex;
|
||||
const fromIndex = indexForItem(selectedItemEl);
|
||||
@ -309,7 +309,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
/********* DOM WRITE ********* */
|
||||
private reorderMove(fromIndex: number, toIndex: number) {
|
||||
const itemHeight = this.selectedItemHeight;
|
||||
const children: any = this.el.__children;
|
||||
const children: any = this.el.__children || this.el.children;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const style = (children[i] as any).style;
|
||||
let value = '';
|
||||
|
||||
Reference in New Issue
Block a user