Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinJS.UI.ToggleSwitch doesn't render properly without inline-block display style #1691

Open
mseminatore opened this issue Nov 26, 2018 · 0 comments

Comments

@mseminatore
Copy link

I've noticed that placing a toggleSwitch inside a div that has custom-styling (e.g. w3-center) causes the toggle switch title to render incorrectly. I found the title text only renders correctly if display: inline-block is set. So it seems like win-toggleswitch wants display: inline-block!important set by default.

You can see this in Try WinJS by changing the HTML to the following:

<div style="text-align:center!important">
            Turn on/off
            <div class="detail">
                checked: true
            </div>
            <div id="wifiToggle" data-win-control="WinJS.UI.ToggleSwitch" data-win-options="{title: 'WiFi', checked: true, onchange: toggleWifi}">
            </div>
            <div class="detail">
                title: 'GPS'
            </div>
            <div data-win-control="WinJS.UI.ToggleSwitch" data-win-options="{title: 'GPS'}">
            </div>
            Customize on/off label
            <div class="detail">
                in Chinese<br />
                labelOn: '&#24320', labelOff: '&#20851'
            </div>
            <div data-win-control="WinJS.UI.ToggleSwitch" data-win-options="{title: 'Bluetooth', labelOn: '&#24320', labelOff: '&#20851'}">
            </div>
            Disable
            <div class="detail">
                disabled: true
            </div>
            <div data-win-control="WinJS.UI.ToggleSwitch" data-win-options="{title: 'BitLocker', checked: true, disabled: true}">
            </div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant