File tree Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
9
9
10
10
### Fixed
11
11
12
- - Fixed issue with the "transparent" CSS value not being transparent when set using python
12
+ - Fixed issue with the "transparent" CSS value not being transparent when set using python https://github.com/Textualize/textual/pull/5890
13
+ - Fixed issue with pushing screens when Input has mouse captured https://github.com/Textualize/textual/pull/5900
14
+
15
+ ## Changed
16
+
17
+ - Widget.release_mouse will now only release the mouse, if it was captured by self https://github.com/Textualize/textual/pull/5900
13
18
14
19
## [ 3.5.0] - 2025-06-20
15
20
Original file line number Diff line number Diff line change @@ -2680,6 +2680,7 @@ async def _replace_screen(self, screen: Screen) -> Screen:
2680
2680
if not self .is_screen_installed (screen ) and all (
2681
2681
screen not in stack for stack in self ._screen_stacks .values ()
2682
2682
):
2683
+ self .capture_mouse (None )
2683
2684
await screen .remove ()
2684
2685
self .log .system (f"{ screen } REMOVED" )
2685
2686
return screen
@@ -2736,6 +2737,7 @@ def push_screen(
2736
2737
else :
2737
2738
future = loop .create_future ()
2738
2739
2740
+ self .app .capture_mouse (None )
2739
2741
if self ._screen_stack :
2740
2742
self .screen .post_message (events .ScreenSuspend ())
2741
2743
self .screen .refresh ()
@@ -2804,6 +2806,7 @@ def switch_screen(self, screen: Screen | str) -> AwaitComplete:
2804
2806
self .log .system (f"Screen { screen } is already current." )
2805
2807
return AwaitComplete .nothing ()
2806
2808
2809
+ self .app .capture_mouse (None )
2807
2810
top_screen = self ._screen_stack .pop ()
2808
2811
2809
2812
top_screen ._pop_result_callback ()
Original file line number Diff line number Diff line change @@ -4341,7 +4341,8 @@ def release_mouse(self) -> None:
4341
4341
4342
4342
Mouse events will only be sent when the mouse is over the widget.
4343
4343
"""
4344
- self .app .capture_mouse (None )
4344
+ if self .app .mouse_captured is self :
4345
+ self .app .capture_mouse (None )
4345
4346
4346
4347
def text_select_all (self ) -> None :
4347
4348
"""Select the entire widget."""
Original file line number Diff line number Diff line change @@ -769,12 +769,19 @@ async def _on_mouse_down(self, event: events.MouseDown) -> None:
769
769
self ._selecting = True
770
770
self .capture_mouse ()
771
771
772
- async def _on_mouse_up (self , event : events .MouseUp ) -> None :
772
+ def _end_selecting (self ) -> None :
773
+ """End selecting if it is currently active."""
773
774
if self ._selecting :
774
775
self ._selecting = False
775
776
self .release_mouse ()
776
777
self ._restart_blink ()
777
778
779
+ async def _on_mouse_release (self , _event : events .MouseRelease ) -> None :
780
+ self ._end_selecting ()
781
+
782
+ async def _on_mouse_up (self , _event : events .MouseUp ) -> None :
783
+ self ._end_selecting ()
784
+
778
785
async def _on_mouse_move (self , event : events .MouseMove ) -> None :
779
786
if self ._selecting :
780
787
# As we drag the mouse, we update the end position of the selection,
You can’t perform that action at this time.
0 commit comments