We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 526bdeb commit f2647bbCopy full SHA for f2647bb
src/textual/dom.py
@@ -479,8 +479,11 @@ def workers(self) -> WorkerManager:
479
def trap_focus(self, trap_focus: bool = True) -> None:
480
"""Trap the focus.
481
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.
+ When applied to a container, this will limit tab-to-focus to the children of that
+ 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.
487
488
Args:
489
trap_focus: `True` to trap focus. `False` to restore default behavior.
0 commit comments