Skip to content

Commit

Permalink
fix(list): add closeSlidingItems()
Browse files Browse the repository at this point in the history
fixes #15378
  • Loading branch information
manucorporat committed Aug 30, 2018
1 parent cf35445 commit 81fbbb8
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions core/src/components/list/list.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Prop } from '@stencil/core';
import { Component, Element, Method, Prop } from '@stencil/core';

import { Mode } from '../../interface';
import { createThemedClasses } from '../../utils/theme';
Expand All @@ -11,7 +11,14 @@ import { createThemedClasses } from '../../utils/theme';
}
})
export class List {
mode!: Mode;

@Element() el!: HTMLElement;

/**
* The mode determines which platform styles to use.
* Possible values are: `"ios"` or `"md"`.
*/
@Prop() mode!: Mode;

/**
* How the bottom border should be displayed on all items.
Expand All @@ -24,6 +31,15 @@ export class List {
*/
@Prop() inset = false;

@Method()
async closeSlidingItems(): Promise<boolean> {
const item = this.el.querySelector('ion-item-sliding');
if (item && item.closeOpened) {
return item.closeOpened();
}
return false;
}

hostData() {
return {
class: {
Expand Down

0 comments on commit 81fbbb8

Please sign in to comment.