Skip to content

Commit 6203b88

Browse files
chore(deps): update @stencil/core to v4.36.2 (#30587)
Issue number: resolves #30565 --------- ## What is the current behavior? Stencil is on v4.33.1 ## What is the new behavior? - Updates Stencil to v4.36.2 - Updates `children` references to `__children` in `reorder-group` ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information I searched through the repository for other components that may be affected but did not find any. Dev build: `8.7.1-dev.11753971948.1b297d94` Reorder Example using dev build: [StackBlitz](https://stackblitz.com/edit/5nrzhbja) Router Example using dev build: [StackBlitz](https://stackblitz.com/edit/rvpcflzx) --------- Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
1 parent fdb7796 commit 6203b88

File tree

6 files changed

+30
-59
lines changed

6 files changed

+30
-59
lines changed

core/package-lock.json

Lines changed: 7 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"loader/"
3232
],
3333
"dependencies": {
34-
"@stencil/core": "4.33.1",
34+
"@stencil/core": "4.36.2",
3535
"ionicons": "^8.0.13",
3636
"tslib": "^2.1.0"
3737
},

core/src/components/reorder-group/reorder-group.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from
66

77
import { getIonMode } from '../../global/ionic-global';
88
import type { Gesture, GestureDetail } from '../../interface';
9+
import type { HTMLStencilElement } from '../../utils/element-interface';
910

1011
import type { ItemReorderEventDetail, ReorderMoveEventDetail, ReorderEndEventDetail } from './reorder-group-interface';
1112

@@ -38,7 +39,7 @@ export class ReorderGroup implements ComponentInterface {
3839

3940
@State() state = ReorderGroupState.Idle;
4041

41-
@Element() el!: HTMLElement;
42+
@Element() el!: HTMLStencilElement;
4243

4344
/**
4445
* If `true`, the reorder will be hidden.
@@ -152,7 +153,7 @@ export class ReorderGroup implements ComponentInterface {
152153
const heights = this.cachedHeights;
153154
heights.length = 0;
154155
const el = this.el;
155-
const children: any = el.children;
156+
const children: any = el.__children;
156157
if (!children || children.length === 0) {
157158
return;
158159
}
@@ -258,7 +259,7 @@ export class ReorderGroup implements ComponentInterface {
258259
private completeReorder(listOrReorder?: boolean | any[]): any {
259260
const selectedItemEl = this.selectedItemEl;
260261
if (selectedItemEl && this.state === ReorderGroupState.Complete) {
261-
const children = this.el.children as any;
262+
const children: any = this.el.__children;
262263
const len = children.length;
263264
const toIndex = this.lastToIndex;
264265
const fromIndex = indexForItem(selectedItemEl);
@@ -308,7 +309,7 @@ export class ReorderGroup implements ComponentInterface {
308309
/********* DOM WRITE ********* */
309310
private reorderMove(fromIndex: number, toIndex: number) {
310311
const itemHeight = this.selectedItemHeight;
311-
const children = this.el.children;
312+
const children: any = this.el.__children;
312313
for (let i = 0; i < children.length; i++) {
313314
const style = (children[i] as any).style;
314315
let value = '';

core/src/components/router/utils/interface.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import type { AnimationBuilder, ComponentProps } from '../../../interface';
1+
import type { AnimationBuilder, ComponentProps, HTMLStencilElement } from '../../../interface';
22
import type { NavigationHookCallback } from '../../route/route-interface';
33

4-
export interface HTMLStencilElement extends HTMLElement {
5-
componentOnReady(): Promise<this>;
6-
}
7-
84
export interface NavOutlet {
95
setRouteId(
106
id: string,

core/src/interface.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export { PickerOptions, PickerColumnOption } from './components/picker-legacy/pi
2323
export { PopoverOptions } from './components/popover/popover-interface';
2424
export { RadioGroupCustomEvent } from './components/radio-group/radio-group-interface';
2525
export { RangeCustomEvent, PinFormatter } from './components/range/range-interface';
26-
export { HTMLStencilElement, RouterCustomEvent } from './components/router/utils/interface';
26+
export { RouterCustomEvent } from './components/router/utils/interface';
2727
export { RefresherCustomEvent } from './components/refresher/refresher-interface';
2828
export {
2929
ItemReorderCustomEvent,
@@ -49,6 +49,7 @@ export {
4949
AnimationKeyFrames,
5050
AnimationLifecycle,
5151
} from './utils/animation/animation-interface';
52+
export { HTMLStencilElement } from './utils/element-interface';
5253
export { TransitionOptions } from './utils/transition';
5354
export { HTMLIonOverlayElement, OverlayController, OverlayInterface } from './utils/overlays-interface';
5455
export { Config, config } from './global/config';

core/src/utils/element-interface.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
// The interfaces in this file are used to make sure our components
22
// have the correct properties defined that are needed to pass to
3-
// the native HTML elements they render
3+
// the native HTML elements they render. The HTMLStencilElement interface
4+
// extends HTMLElement to provide Stencil-specific functionality like
5+
// componentOnReady() and proper children handling.
6+
7+
export interface HTMLStencilElement extends HTMLElement {
8+
componentOnReady(): Promise<this>;
9+
/**
10+
* Stencil patches `el.children` to behave like calling `el.children` on an
11+
* element with shadow DOM even though the component is not a shadow DOM element.
12+
* To allow components to work properly we need to access the original accessor
13+
* for this property which is `__children`.
14+
*/
15+
__children?: HTMLCollection;
16+
}
417

518
export interface AnchorInterface {
619
href: string | undefined;

0 commit comments

Comments
 (0)