From c38aa07cf8bfab200b3c071328d893bd1627cde7 Mon Sep 17 00:00:00 2001 From: Brandy Smith Date: Tue, 10 Jun 2025 14:11:09 -0400 Subject: [PATCH] fix(item-sliding): check for side attribute to avoid an `undefined` value (#29845) Issue number: resolves #29499 --------- ## What is the current behavior? Using the bundled version of Ionic results in an error `Uncaught (in promise) Error: "undefined" is not a valid value for [side]. Use "start" or "end" instead.` with ``. Reproduction 1: - https://stackblitz.com/edit/stackblitz-starters-mezoy6?file=index.html - Press the Add (`+`) button several times It is also reproducible in an Ionic Angular app when installed via npm. Reproduction 2: - https://stackblitz.com/edit/angular-exwgke?file=src%2Fapp%2Fexample.component.ts - Press the `Add Items` button several times ## What is the new behavior? Check for the side attribute to avoid `side` being `undefined`. ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information Dev build: `8.6.1-dev.11749562115.1e681558` Test PR: https://github.com/ionic-team/ionic-framework/pull/30469 The tests must be merged separately, after this is released, in order to use the fix from the CDN. --------- Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com> --- core/src/components/item-sliding/item-sliding.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/components/item-sliding/item-sliding.tsx b/core/src/components/item-sliding/item-sliding.tsx index ef9eaae327..ba979164c4 100644 --- a/core/src/components/item-sliding/item-sliding.tsx +++ b/core/src/components/item-sliding/item-sliding.tsx @@ -263,7 +263,7 @@ export class ItemSliding implements ComponentInterface { // eslint-disable-next-line custom-rules/no-component-on-ready-method const option = (item as any).componentOnReady !== undefined ? await item.componentOnReady() : item; - const side = isEndSide(option.side) ? 'end' : 'start'; + const side = isEndSide(option.side ?? option.getAttribute('side')) ? 'end' : 'start'; if (side === 'start') { this.leftOptions = option;