Undefined properties. Problems with 'selectableComponent' variable
I am running an Ionic 6 Capacitor(v4.6.2) app.
It has "@ionic-selectable/angular": "^5.0.0-alpha.19" installed.
The module is imported in my app component and the child component. (I am using the new Angular standalone: true methods for my components.)
The ionic-selectable component loads correctly in the ion-item. But once it is opened, the console is bombarded with:
Cannot read properties of undefined (reading 'selectableComponent') Cannot read properties of undefined (reading 'isAddItemTemplateVisible') Cannot read properties of undefined (reading 'shouldFocusSearchbar') Cannot read properties of undefined (reading 'selectableComponent')
The first error seems to stem from a method called connectedCallback, which looks like the following:
const modalElement = document.querySelector('ion-modal'); this.selectableComponent = modalElement.componentProps.selectableComponent; this.selectableComponent.selectableModalComponent = this;
And it looks like componentProps is undefined, causing the error, and keeping selectableComponent null/undefined which crashes other code.
Hi, I am facing the same issue. It works find on the page but not working in the modal. Regards