Desktop Buttons take keyboard focus when clicked on macOS
- Status
- Accepted
- Fixed in
- -
- Area
- desktop
- Source discussion
- https://forum.objo.dev/d/1226-buttons-bug
- Last updated
- 2026-09-29
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
On macOS, clicking a Button in a desktop app takes the keyboard focus away from whatever had it — most visibly a TextField the user was typing in. Native macOS apps do not do this: clicking a push button never moves key focus, so the user can click a button and keep typing without clicking back into the field. With Objo the field silently loses focus: typing goes nowhere until the field is clicked again, the field's selection disappears, and anything wired to the field's FocusLost event (validation, saving edits) fires on every button click.
Button.TabStop = False does not help because it only removes the button from the Tab key order; it does not control focus on click.
Expected behaviour: on macOS, clicking a Button (and other push-button-style action controls) should perform its action without changing keyboard focus. Windows behaviour is correct as it is — buttons taking focus on click is the Windows platform convention — so this is a macOS-only fix.