@@ -545,27 +545,29 @@ class PriorityOverlapWidget(Static, can_focus=True):
545545 """A focusable widget with a priority binding."""
546546
547547 BINDINGS = [
548- Binding ("0" , "app. record('widget_0')" , "0" , priority = False ),
549- Binding ("a" , "app. record('widget_a')" , "a" , priority = False ),
550- Binding ("b" , "app. record('widget_b')" , "b" , priority = False ),
551- Binding ("c" , "app. record('widget_c')" , "c" , priority = True ),
552- Binding ("d" , "app. record('widget_d')" , "d" , priority = False ),
553- Binding ("e" , "app. record('widget_e')" , "e" , priority = True ),
554- Binding ("f" , "app. record('widget_f')" , "f" , priority = True ),
548+ Binding ("0" , "record('widget_0')" , "0" , priority = False ),
549+ Binding ("a" , "record('widget_a')" , "a" , priority = False ),
550+ Binding ("b" , "record('widget_b')" , "b" , priority = False ),
551+ Binding ("c" , "record('widget_c')" , "c" , priority = True ),
552+ Binding ("d" , "record('widget_d')" , "d" , priority = False ),
553+ Binding ("e" , "record('widget_e')" , "e" , priority = True ),
554+ Binding ("f" , "record('widget_f')" , "f" , priority = True ),
555555 ]
556556
557+ async def action_record ( self , key : str ) -> None :
558+ await self .app .action_record ( key )
557559
558560class PriorityOverlapScreen (Screen ):
559561 """A screen with a priority binding."""
560562
561563 BINDINGS = [
562- Binding ("0" , "app. record('screen_0')" , "0" , priority = False ),
563- Binding ("a" , "app. record('screen_a')" , "a" , priority = False ),
564- Binding ("b" , "app. record('screen_b')" , "b" , priority = True ),
565- Binding ("c" , "app. record('screen_c')" , "c" , priority = False ),
566- Binding ("d" , "app. record('screen_d')" , "c" , priority = True ),
567- Binding ("e" , "app. record('screen_e')" , "e" , priority = False ),
568- Binding ("f" , "app. record('screen_f')" , "f" , priority = True ),
564+ Binding ("0" , "record('screen_0')" , "0" , priority = False ),
565+ Binding ("a" , "record('screen_a')" , "a" , priority = False ),
566+ Binding ("b" , "record('screen_b')" , "b" , priority = True ),
567+ Binding ("c" , "record('screen_c')" , "c" , priority = False ),
568+ Binding ("d" , "record('screen_d')" , "c" , priority = True ),
569+ Binding ("e" , "record('screen_e')" , "e" , priority = False ),
570+ Binding ("f" , "record('screen_f')" , "f" , priority = True ),
569571 ]
570572
571573 def compose (self ) -> ComposeResult :
@@ -574,6 +576,8 @@ def compose(self) -> ComposeResult:
574576 def on_mount (self ) -> None :
575577 self .query_one (PriorityOverlapWidget ).focus ()
576578
579+ async def action_record ( self , key : str ) -> None :
580+ await self .app .action_record ( key )
577581
578582class PriorityOverlapApp (AppKeyRecorder ):
579583 """An application with a priority binding."""
@@ -593,6 +597,9 @@ class PriorityOverlapApp(AppKeyRecorder):
593597 def on_mount (self ) -> None :
594598 self .push_screen ("main" )
595599
600+ async def action_record ( self , key : str ) -> None :
601+ await super ().action_record ( key )
602+
596603
597604async def test_overlapping_priority_bindings () -> None :
598605 """Test an app stack with overlapping bindings."""
0 commit comments