locked
Default behavior of WinJS.UI.ToggleSwitch different from other ToggleSwitches in Metro?

    Question

  • When I add a ToggleSwitch like this:

    <div data-win-control="WinJS.UI.ToggleSwitch" data-win-options="{title: test}"></div>

    The resulting ToggleSwitch behaves quite different from the ones I can find in Win8 otherwise. Specifically with this toggleswitch (when you use the mouse) you have to click on the side of the switch that is not active. Say, your switch is on the left (OFF) and you want to turn it on you will need to click on the right side of the switch to do that. If you click on the left side (even when it's just slightly off the center) the switch moves a bit but ultimately falls back to the OFF setting.

    However, when I look at the switch in say Settings\Wi-Fi the switch there accepts a click anywhere. How can I get this behavior with WinJS.UI.ToggleSwitch?


    • Edited by PatrickKlug Thursday, April 26, 2012 3:07 AM
    Thursday, April 26, 2012 3:06 AM

Answers

  • Hi Patrick,

    You are seeing different behavior because the WinJS toggle switch does not behave the same as the XAML toggle.

    I have filed a bug on this because I would expect them to behave the same.

    Thanks for reporting this!

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, April 26, 2012 3:50 PM
    Moderator

All replies

  • Hi Patrick,

    You are seeing different behavior because the WinJS toggle switch does not behave the same as the XAML toggle.

    I have filed a bug on this because I would expect them to behave the same.

    Thanks for reporting this!

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, April 26, 2012 3:50 PM
    Moderator
  • Thanks Jeff. Appreciate it.
    Friday, April 27, 2012 11:29 PM