Skip to content

Commit f2647bb

Browse files
committed
better doc
1 parent 526bdeb commit f2647bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/textual/dom.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,11 @@ def workers(self) -> WorkerManager:
479479
def trap_focus(self, trap_focus: bool = True) -> None:
480480
"""Trap the focus.
481481
482-
When applied to a container, pressing tab to change focus will be limited to the container's
483-
children if one of the children currently has focus.
482+
When applied to a container, this will limit tab-to-focus to the children of that
483+
container (assuming focus is within that container).
484+
485+
This can be useful for widgets that act like modal dialogs, where you want to restrict
486+
the user the controls within the dialog.
484487
485488
Args:
486489
trap_focus: `True` to trap focus. `False` to restore default behavior.

0 commit comments

Comments
 (0)