Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined properties. Problems with 'selectableComponent' variable #409

Open
Sebastian-Elstadt opened this issue Jan 30, 2023 · 1 comment

Comments

@Sebastian-Elstadt
Copy link

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.

@schagani
Copy link

schagani commented Mar 8, 2023

Hi,
I am facing the same issue. It works find on the page but not working in the modal.
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants