0 Favourites

Disabled buttons can be pressed

  • Problem Description

    As subject says, the problem is that disabled buttons can be pressed and runs an event.

    On Chrome, buttons works fine if are visible and disabled: they can't be pressed.

    On Firefox and Internet Explorer, buttons can be pressed also if are visible and disabled.

    Attach a Capx

    Description of Capx

    With this Capx you can see that pressing where there is an invisible and disabled button, an event will work anyway.

    Steps to Reproduce Bug

    • Run Layout
    • Press where the yellow button is

    Observed Result

    Text "Hi" will appear also if invisible button is disabled (invisible button is on yellow area).

    Expected Result

    Text "Hi" should not appear because button is set on "disabled".

    Affected Browsers

    • Chrome: YES (only if button is invisible and disabled)
    • FireFox: YES (also if button is visible and disabled)
    • Internet Explorer: YES (also if button is visible and disabled)

    Operating System and Service Pack

    Windows 7 64 bit SP1

    Construct 2 Version ID

    r172

  • Yep. I guess you are right.

    Windows 8.1 Update 1 x64, Construct 2 R173 x64

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I don't use buttons in C2, never have - I use sprites, but I agree, it doesn't work.

  • Totally agree on this one, but i took it more of a "It's a feature, not a bug" approach.

    But while we are at it, a few additions to the Button object could be great:

    Condition - If disabled

    Condition - If hovered

    Condition - On Right Clicked

    Expression - Button State (Disabled, Enabled, Hovered)

    These additions might could come in handy, at least for me

    Especially the On Right Clicked and If Disabled is important for me.

    • Conti
  • Closing as not a bug. The 'Button: on clicked' trigger does not fire if the button is invisible or disabled. However you have 'Is touching button' in an OR block, and the touch object is set to use mouse input. By design, 'Is touching object' just checks if there is a touch within the object's rectangle regardless of its settings, so this is working correctly.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)