Skip to content

Commit c38aa07

Browse files
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 `<ion-item-sliding>`. 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: #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>
1 parent 071b414 commit c38aa07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/components/item-sliding/item-sliding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export class ItemSliding implements ComponentInterface {
263263
// eslint-disable-next-line custom-rules/no-component-on-ready-method
264264
const option = (item as any).componentOnReady !== undefined ? await item.componentOnReady() : item;
265265

266-
const side = isEndSide(option.side) ? 'end' : 'start';
266+
const side = isEndSide(option.side ?? option.getAttribute('side')) ? 'end' : 'start';
267267

268268
if (side === 'start') {
269269
this.leftOptions = option;

0 commit comments

Comments
 (0)