Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
JavaScript/jQuery only execute on first tab of tabbar (iOS only, bug?) *SOLVED* can someone explain?
-
Please skip down to the bottom of this post
Title says it all. I have run into this problem multiple times.
I am unable to execute any code that is not on the first tab in the tabbar on iOS.
This problem does not exist on Desktop or Android, only iOS.
First Example:
I have a tabbar with three tabs:- view info about item to purchase
- view info about seller
- purchase via creditcard/paypal (both JavaScript)
The scripts do not work unless I move everything to the first tab.
Second Example:
I have another tabbar with 4 tabs:- google maps (JS)
- date picker (jQuery)
- start time picker (jQuery)
- end time picker (jQuery)
Only the google maps script execute properly. Again, if I move everything to the first tab, it works fine.
The scripts only work on the tab that is marked “active”. So if I mark the start time picker tab as active, then only that code will execute correctly.
I do not think this is an error on my end, because my code works perfectly fine on Desktop and Android.
I do not understand why only iPhone is affected, and believe it may be a bug.Has anyone run into this problem before?
Skip here
So I didn’t know 2.0.2 was out, and upgrading to that fixed this issue that I’ve had for over a month.
After looking at the changelog, the only change I read that might have affected my issue was:ons-tab: Add badge attribute to display notification on tab.
@Fran-Diox Do you know what this change is about?
-
@rgins16 Not certain, but a lot of issues centered around Onsen’s use of polyfills and the createElement aspect. They fixed a lot of that and I think everything was inter-related because of it.
-
@rgins16 @munsterlander The new polyfill is a bit different from the previous one so we had to refactor tabbar in order to make it more robust and avoid problems. Looks the refactoring wasn’t added to the changelog but it actually fixed those issues.
-
@Fran-Diox Awesome, I’m so happy to see this is finally fixed!