Skip to content

Commit df1bcd5

Browse files
committed
Fix bindings action
1 parent 124df59 commit df1bcd5

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/textual/_compositor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def add_widget(
449449
map[widget] = MapGeometry(
450450
region + layout_offset,
451451
order,
452-
clip if widget.is_container else sub_clip,
452+
clip,
453453
total_region.size,
454454
container_size,
455455
virtual_region,

src/textual/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,13 +1742,12 @@ async def check_bindings(self, key: str, priority: bool = False) -> bool:
17421742
"""Handle a key press.
17431743
17441744
Args:
1745-
key (str): A key
1745+
key (str): A key.
17461746
priority (bool): If `True` check from `App` down, otherwise from focused up.
17471747
17481748
Returns:
17491749
bool: True if the key was handled by a binding, otherwise False
17501750
"""
1751-
17521751
for namespace, bindings in (
17531752
reversed(self._binding_chain) if priority else self._binding_chain
17541753
):
@@ -2053,7 +2052,8 @@ async def _prune_node(self, root: Widget) -> None:
20532052
self._unregister(root)
20542053

20552054
async def action_check_bindings(self, key: str) -> None:
2056-
await self.check_bindings(key)
2055+
if not await self.check_bindings(key, priority=True):
2056+
await self.check_bindings(key, priority=False)
20572057

20582058
async def action_quit(self) -> None:
20592059
"""Quit the app as soon as possible."""

src/textual/binding.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ def make_bindings(bindings: Iterable[BindingType]) -> Iterable[Binding]:
7777
description=binding.description,
7878
show=binding.show,
7979
key_display=binding.key_display,
80-
priority=default_priority
81-
if binding.priority is None
82-
else binding.priority,
80+
priority=(
81+
default_priority
82+
if binding.priority is None
83+
else binding.priority
84+
),
8385
)
8486

8587
self.keys: MutableMapping[str, Binding] = (

0 commit comments

Comments
 (0)