eakoriakin / ionic-selectable

Ionic Selectable is an Ionic versatile and highly customizable component that serves as a replacement to Ionic Select, and allows to search items, including async search, create items, customize the layout with templates and much more. It provides an intuitive API and is easy to set up and use.
MIT License
550 stars 123 forks source link

ERROR IonicSelectable is disabled or already opened. #445

Open loneoakdev opened 8 months ago

loneoakdev commented 8 months ago

Running Ionic v7.6.1 with Ionic Selectable v5.0.3. Problem only occurs when running in iOS Simulator or on an actual iOS device (haven't tested with Android yet). Clicking on selectable component the first time doesn't do anything. Clicking on it a second time generates the error in the Xcode console and the selectable modal never opens up. The error in the Xcode console is:

[error] - ERROR IonicSelectable is disabled or already opened.

I tried interrupting the open() and search() methods and using:

this.portComponent.open().catch(() => { }); or if (this.portComponent.isEnabled && !this.portComponent.isOpened) { this.portComponent.open(); }

Neither one of those changed anything and the error still displays with the same behavior.

Here is my component code ` <ionic-selectable [canClear]="true" [canSearch]="true" class="ion-margin-top" formControlName="upline" [items]="uplineList()" itemTextField="displayName" itemValueField="uid" (onSearch)="onUplineSearch($event)"

I also have another one on the same page without search that has the exact same issue and error <ionic-selectable [canClear]="true" [canSearch]="true" class="ion-margin-top" formControlName="timezone" groupValueField="utcOffsetStr" groupTextField="utcOffsetStr" [items]="timezoneList" itemTextField="name" itemValueField="id" `

Any help is much appreciated!