INNER CODE UNIT · Python
on_search_submitted
idoavrah/terraform-tui · src/tftui/app.py:257
def on_search_submitted(self) -> None:
"""Enter hands focus to the pane so n/N and scrolling work."""
pane = self._searchable
(pane or self.state_tree).focus()
def action_search(self) -> None:
"""Search the current pane: the tree filters, the others highlight."""
target = self.view if self.view in (RESOURCE, PLAN) else TREE
if target == TREE:
self._show(TREE)
# Re-entering the search box must keep what is already typed, so it can
# be extended or corrected. The text only means something within one
# pane, so switching panes starts afresh.
if target != self._search_target:
self._clear_search()
self._search_target = target
self.search_input.placeholder = _SEARCH_PLACEHOLDER[target]