Refuse focus, not just activation, on a click over a disabled control - #57
Merged
Merged
Conversation
A click on a control the frame drew as disabled did not run its action, but it still moved detail focus onto the control — and a focused control renders with the full accent style, indistinguishable from an enabled one. Clicking a live session's greyed-out [Del] therefore lit it up as if it had activated. A click on a disabled control is now inert entirely: no focus move, no action, exactly as Textual treated disabled widgets. The keyboard cursor can still rest on one; only the mouse path changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clicking a disabled detail-pane control (e.g. the greyed-out
[Del]on a live Claude session) did not run the action, but it still moved detail focus onto the control. A focused control renders with the full accent style whether or not it is enabled, so the disabled button lit up as if it had activated — a purely visual lie.A click on a control drawn as disabled is now inert entirely: it neither fires nor takes focus, matching how the Textual build treated disabled widgets. Keyboard navigation is unchanged — the cursor can still pass over and rest on a disabled control, where the legible focused style is deliberate.
The click resolves against the
drawn_itemssnapshot before touching focus, for the same reason activation always did: the snapshot is the frame the user clicked on.Verified with
tu: clicking↓ Git Pull (No remote)leaves it grey with focus untouched; clicking the enabledAdd Worktreestill opens the modal.make checkpasses; the existinga_disabled_control_does_not_activatetest now also asserts focus stays put.