Space bar not working on WebButton

  1. 4 weeks ago

    Dan H

    Nov 9 Pre-Release Testers, Xojo Pro

    Starting with 2018r1.1, open a new web project drag a text field and Web Button to the window, put something in the action event and run. If I press the tab key until the button is selected, I cannot press the space bar to select it. (Firefox & Google Chrome). It works fine with the same test on 2017r3.

    Safari does not allow focus on a button and so it would never work that way, but I have many Windows users that are familiar with that functionality.

    Is this a defect?

  2. Louis D

    Nov 9 Pre-Release Testers, Xojo Pro Montreal, QC, Canada

    This will not answer your question directly, but offer a workaround for the unwanted behavior.
    1- place the webbutton action event code in a page (or container) method. In the action event handler, call the new method.
    2- add the "keypressed" event handler to the page. In response to "KeySpace", call the button method. Return true for any unhandled other key.

    Whether this is a defect or not, your application will behave the way you want it to. Now, considering that I usually have more than one button on a page, I would not think of using this behavior. Using the space bar or any other key without focus can only work with one button each.

  3. Dan H

    Nov 12 Pre-Release Testers, Xojo Pro

    Thank you for the suggestion. Regarding your last comment, remember that Windows does allow focus on a button and I (and other Windows users) who use the keyboard more than the mouse, expect this behavior - it saves time. For at least Firefox and Chrome, focus is allowed.

  4. Ralph A

    Nov 14 Santa Monica, California

    @Dan H Starting with 2018r1.1, open a new web project drag a text field and Web Button to the window, put something in the action event and run. If I press the tab key until the button is selected, I cannot press the space bar to select it. (Firefox & Google Chrome). It works fine with the same test on 2017r3.

    Safari does not allow focus on a button and so it would never work that way, but I have many Windows users that are familiar with that functionality.

    Is this a defect?

    I see that behavior here too, on the Mac. You can always hit the Enter key to execute the button action, though. But Mac users are used to being able to use the spacebar for this.

or Sign Up to reply!