[Silk UI Web ] Support for disabled ToggleButton

[Silk UI Web ] Support for disabled ToggleButton

Forge Component
Published on 2016-11-11 by OutSystems Labs
49 votes
Published on 2016-11-11 by OutSystems Labs
Looks like it doesnt honor the disabled attribute.

I added an if statement around the change handler to solve. Is there any reason why this shouldnt be part of the base?

New code highlighted (from ToggleScript):

function toggleButton(){
    var that = this;
    function onChange() {
    function onFocus() {
        /* set focus */
       /* $(this).closest('label').parent().css("outline-color", "#336600");*/
    function onFocusOut() {
        $(this).closest('label').parent().css("outline-color", "transparent");
    function initToggle() {
        $('.ToggleButton_label:not(.toggled) input').each(function(){
            if ($(this).is(':checked')) {
            /* honor diabled attribute */
            if( !$(this).is(":disabled") ) {
                        $(this).on("change", onChange);
            $(this).on("focus", onFocus);
            $(this).on("focusout", onFocusOut);
Hello Robert,

So far I wasn't able to replicate your issue.
When I use a disabled checkbox inside a toggleButton, the toggleButton is not selectable.

Can you provided us an example of  your implementation (screenshot or even a clean eSpace with the issue replicated)?

Best regards,
Samuel Jesus