Skip to content

Commit 295f95b

Browse files
committed
Add section on "focusable widgets" to "Input" page of guide
1 parent e54db0e commit 295f95b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/guide/input.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ Textual will handle keyboard focus automatically, but you can tell Textual to fo
121121

122122
When a widget receives focus, it is sent a [Focus](../events/focus.md) event. When a widget loses focus it is sent a [Blur](../events/blur.md) event.
123123

124+
### Focusable widgets
125+
126+
Each widget has a boolean `can_focus` attribute which determines if it is capable of receiving focus.
127+
Note that `can_focus=True` does not mean the widget will _always_ be focusable.
128+
For example, a disabled widget cannot receive focus even if `can_focus` is `True`.
129+
124130
## Bindings
125131

126132
Keys may be associated with [actions](../guide/actions.md) for a given widget. This association is known as a key _binding_.

0 commit comments

Comments
 (0)