Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Switch triggers change on window opening and animates if value=true

This happens when running the app on iPhone simulator and on the actual device too. Switches are part of a TableViewRow.

What happens exactly is that a change is triggered on the switch as soon as the window is loaded on screen. It doesn't matter if the value is true or false.

What this causes is that any switch with a default value of true will animate from "off" to "on" as the user scrolls or loads a window. This can cause confusion on users, making them think they clicked on the switch by mistake while scrolling.

Anyone found any solution to that? I'm specially interested in the switches not animating to "on" state when the window loads. It didn't happen in earlier versions of Titanium, on the old table creation methods, so I guess there is a solution we haven't been able to find.

Thanks!

— asked June 17th 2010 by Marcel Neumann
  • change
  • event
  • iphone
  • mobile
  • switch
  • trigger
5 Comments
  • I've seen this has been fixed with mobile sdk 1.4

    — commented July 30th 2010 by Marcel Neumann
  • I have the same issue. Anyone have a solution?

    — commented November 11th 2010 by Jean-Rene Auger
  • I'm also seeing this issue, it seems 2 years later!

    — commented May 23rd 2012 by B R
  • Just opened ticket for that.

    — commented May 24th 2012 by Dino Bartosak
  • I'm seeing something similar - the switch registers the 'change' event more than once per click and eventually disables itself. (There is nothing in my code to disable the switch)

    — commented July 27th 2012 by Amy H

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.