-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
[BUG] Ionic apps required await for componentOnReady() before set event listeners #216
Comments
Addressed to ionic-team/ionic-framework#27984 |
It appears that When trying to use this panes library, I receive the following error: I've read through the changelog but can't find anything to suggest that it was removed. I'm on version 7 of ionic. As a temporary workaround, I have stubbed out the method so this library doesn't error: useEffect(() => {
(document.querySelector('ion-app') as any).componentOnReady = () => {};
myPane.current = new CupertinoPane(panelRef.current!, {
parentElement: 'body',
breaks: {
middle: { enabled: true, height: 300, bounce: true },
bottom: { enabled: true, height: 80 },
},
events: {
onDrag: () => console.log('Drag event'),
},
});
}, []); |
Hello @chrisk-7777 It seems that You probably won't use I suspect that when you try to call this method inside of What do you think? |
Hey @roman-rr thanks for the reply! Honestly, I'm not too sure - I'm not familiar with stencil at all. This is just a fresh ionic 7 app with only pane installed. Sorry - to be clear, I'm not using componentOnReady directly. It seems pane uses it under the hood if it detects an ionic app in use (https://github.com/tech-systems/panes/blob/master/src/cupertino-pane.ts#L290). If I add a breakstop to that line, and inspect I've tried to hunt around the Stencil docs for Typically One interesting difference between your fiddle and my react version is I'm happy to continue with my workaround, it seems to work. Do you know of any react + ionic + panes simple examples available, I could be missing something painfully obvious. |
@chrisk-7777 Thank you for details. Are you able to repository with demo code, or create environment with react and simple reproduction on jsfiddle or similar platforms? |
Yup, easy one: https://github.com/chrisk-7777/ionic-7-pane-demo
Then click the "open pane" button on Tab1. There are only two commits, commit 1 is the base ionic install, commit 2 is adding pane. Note that by uncommenting the line here then it works, because the componentOnReady method is stubbed. |
@chrisk-7777 Thank you, I pushed fix and its available from master branch. |
Awesome, thanks @roman-rr ! |
Sorry a bit of a delay, but can confirm that latest commit did solve the issue 👍 |
Describe the bug
Something in Ionic bundle, and can be addressed to Ionic repository.
Can be fixed with:
The text was updated successfully, but these errors were encountered: