Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    bug: disabled Button on StatefulCanvas breaks parent "Over" style

    Hi,

    When you put Button with enabled = false as a child of StatefulCanvas and move mouse over this button StatefulCanvas loses Over state.

    Paste this code to that demo: http://www.smartclient.com/smartclie...d=buttonStates

    Code:
    var parent = isc.SimpleTile.create({
        baseStyle: "cssButton",
        contents: "StatefulCanvas",
        width: 200,
        height: 200,
        left: 100,
        top: 00
    });
    
    var childDisabled = isc.Button.create({
      left: 20,
      top: 20,
      width: 100,
      height: 50,
      title: "Button",
      enabled: false
    });
    
    var childEnabled = isc.Button.create({
      left: 20,
      top: 20+50+20,
      width: 100,
      height: 50,
      title: "Button",
      enabled: true
    });
    
    parent.addChild(childDisabled);
    parent.addChild(childEnabled);
    Best regards,
    Janusz

    #2
    This happens because a disabled component stops the bubbling of events on it, since it is disabled. It's not clear that this is incorrect behavior, since clicking the button does nothing, and an "Over" state is generally used to indicate to an end user that a component is interactive.

    If, in your use case, clicking the button will actually do something, for this case (which seems uncommon), you could consider styling the button like it is disabled, without disabling it per se.

    Comment

    Working...
    X