You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Knockout 3.4.0 in an iOS 9 embedded UIWebView (or from a "iOS Web App" that has been pinned to the home screen from Safari), there seems to be an issue that causes Kncokout microtasks to stop running. This then causes other problems in Knockout - for example, components on the page will no longer update as expected. The issue doesn't seem to happen in the full mobile Safari browser.
The problems start when a microtask is scheduled to run while the page is scrolling.
Load the HTML from the gist in the full mobile Safari browser, tap the share button at the bottom, and then "Add to home screen".
Open the page from the new home screen icon rather than in full mobile Safari, and then tap the button a few times. You should see sequential numbers appear on the page below the button.
Pull the page down from the top, let go, and then while the button is scrolling back up to the top, tap the button again. Note that this tap won't generate a number.
Also note that additional taps on the button (even after scrolling has stopped) still won't trigger a number to show up. The microtasks seem to queue up, but don't run anymore.
I also found that the Bluebird project (where some of the microtask code originally came from) had this same problem. For reference, here is the discussion and how the issue was fixed in that project: petkaantonov/bluebird#666
The text was updated successfully, but these errors were encountered:
It looks like the solution they put into Bluebird is to check window.navigator.standalone and then use setImmediate or setTimeout. Thus a Knockout application could apply the same logic as a workaround:
When using Knockout 3.4.0 in an iOS 9 embedded UIWebView (or from a "iOS Web App" that has been pinned to the home screen from Safari), there seems to be an issue that causes Kncokout microtasks to stop running. This then causes other problems in Knockout - for example, components on the page will no longer update as expected. The issue doesn't seem to happen in the full mobile Safari browser.
The problems start when a microtask is scheduled to run while the page is scrolling.
I've put together an example HTML file that can be used to reproduce the issue when loaded on an iPhone as a pinned "iOS Web App": https://gist.github.com/joshbarger/a8c60ce3ea1245b48af41ad5c515e302
I also found that the Bluebird project (where some of the microtask code originally came from) had this same problem. For reference, here is the discussion and how the issue was fixed in that project: petkaantonov/bluebird#666
The text was updated successfully, but these errors were encountered: