Our pure JavaScript Scheduler component


Post by peterjc »

Hi, this is a really weird problem that has started after I updated from the scheduler from v3.1.3 to 5.0.6 , I only have when running my Ionic/Cordova application on either an iPad or an iPad emulator. It does not occur if I just run in Safari, or on other platforms.

Running the version 3.1.3 of the scheduler, using Safari devtools to examine the dom while it is running in an iPad emulator, I always see the scheduler's parent component inside the router outlet.

schedulerv3.png
schedulerv3.png (317.98 KiB) Viewed 480 times

However, after I updated to 5.0.6, even if I remove all my component code, and all I have in the markup is

<ion-content>
  <bryntum-scheduler >
  </bryntum-scheduler>
</ion-content>

I get the following...

When I first open the component, it is inside the router outlet as expected....

schedulerv5a.png
schedulerv5a.png (218.84 KiB) Viewed 480 times

However, once I navigate back to the home page, away from the component containing the scheduler, the next time I go to either the component container the scheduler, or ANY other component, they now appear OUTSIDE of the router outlet.

schedulerv5b.png
schedulerv5b.png (300.17 KiB) Viewed 480 times

I have removed every bit of my code from the from the component, and the scheduler tag (as can be seen above) is completely empty.

Its like when it is being removed somehow it is doing something weird to the DOM.

Has this been seen before, and would have any idea what could cause this. Once again this is only on a mac, when running inside an iPad (happens on both the emulator and a real ipad)

I have no idea what to try here

Thanks in advance for any suggestions


Post by peterjc »

Just a little bit more info. When this is happening, there is an unhandled exception, the only time I see this exception is when running on the ipad (emulator in this case)

ex1.png
ex1.png (557.89 KiB) Viewed 471 times

If I go up one level to the call in the scheduler.lite.umd.js, I see the following....

ex2.png
ex2.png (522.53 KiB) Viewed 471 times

I am not sure if this is related to the problem here, I was just looking for any unhandled exceptions


Post by peterjc »

Also, I tried to modify the source to stop this error, just to see if it could be related..

src1.png
src1.png (370.54 KiB) Viewed 471 times

But when I build and run it, the modification is not picked up.

ie in Safari dev tools, I still see the exception and the original code without the added "if" (is there a way I can try this)


Post by peterjc »

Hi, I was able to edit the source file, and after I added the "ïf", the problem was fixed, ie

static unFullscreenChange(fn) {
            if (this.events && this.events.length > 0)
              document.removeEventListener(this.events[0], fn);
          }

I dont know why this is only needed on ios device', but with this is there is no more exception, and the app no longer becomes corrupt'.

But I only added the above in the redist file deployed to the application (ie ends up in vendor.js) - just as a test.

Also, I added an alert where the this.events is instantiated...

this.events = 'fullscreenEnabled' in document && eventNames || 'webkitFullscreenEnabled' in document && prefixEvt('webkit') || 'mozFullscreenEnabled' in document && prefixEvt('moz') || 'msFullscreenEnabled' in document && msEventNames || [];

alert("events length = " + this.events.length)

And events.length is 0 (hence why we later get the exception)

This code appear to originate from Fullscreen.js, and in this case, this.events ends up being the final value - an empty list.

src3.png
src3.png (68.55 KiB) Viewed 454 times

Post by alex.l »

Hi peterjc,

That's good news you are unblocked now.
3.1.3 has been release 2 years ago, that's a huge update on your side!
I read all the information provided and see the problem you found. All sounds reasonable for us.
I've opened a ticket to apply the fix you suggested in our codebase https://github.com/bryntum/support/issues/4921

Thank you!

All the best,
Alex


Post by alex.l »

Small update - I closed just created ticket because it's already fixed in another your thread https://github.com/bryntum/support/issues/4916

All the best,
Alex


Post Reply