Skip to content

Commit 96ee503

Browse files
committed
Merge branch 'main' into ungreedyify-textarea
2 parents 5aa05f3 + 8c0077a commit 96ee503

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3232
- Fixed `OptionList.OptionHighlighted` leaking out of `Select` https://github.com/Textualize/textual/issues/4224
3333
- Fixed `Tab` enable/disable messages leaking into `TabbedContent` https://github.com/Textualize/textual/issues/4233
3434
- Fixed a style leak from `TabbedContent` https://github.com/Textualize/textual/issues/4232
35+
- Fixed active hidden scrollbars not releasing the mouse https://github.com/Textualize/textual/issues/4274
3536
- Fixed the mouse not being released when hiding a `TextArea` while mouse selection is happening https://github.com/Textualize/textual/issues/4292
3637

3738
### Changed

src/textual/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2706,7 +2706,7 @@ def refresh_css(self, animate: bool = True) -> None:
27062706
stylesheet.set_variables(self.get_css_variables())
27072707
stylesheet.reparse()
27082708
stylesheet.update(self.app, animate=animate)
2709-
self.screen._refresh_layout(self.size, full=True)
2709+
self.screen._refresh_layout(self.size)
27102710
# The other screens in the stack will need to know about some style
27112711
# changes, as a final pass let's check in on every screen that isn't
27122712
# the current one and update them too.

src/textual/screen.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,7 @@ def _pop_result_callback(self) -> None:
751751
"""Remove the latest result callback from the stack."""
752752
self._result_callbacks.pop()
753753

754-
def _refresh_layout(
755-
self, size: Size | None = None, full: bool = False, scroll: bool = False
756-
) -> None:
754+
def _refresh_layout(self, size: Size | None = None, scroll: bool = False) -> None:
757755
"""Refresh the layout (can change size and positions of widgets)."""
758756
size = self.outer_size if size is None else size
759757
if not size:
@@ -850,15 +848,15 @@ async def _on_update_scroll(self, message: messages.UpdateScroll) -> None:
850848

851849
def _screen_resized(self, size: Size):
852850
"""Called by App when the screen is resized."""
853-
self._refresh_layout(size, full=True)
851+
self._refresh_layout(size)
854852
self.refresh()
855853

856854
def _on_screen_resume(self) -> None:
857855
"""Screen has resumed."""
858856
self.stack_updates += 1
859857
self.app._refresh_notifications()
860858
size = self.app.size
861-
self._refresh_layout(size, full=True)
859+
self._refresh_layout(size)
862860
self.refresh()
863861
# Only auto-focus when the app has focus (textual-web only)
864862
if self.app.app_focus:

src/textual/widget.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3165,7 +3165,7 @@ def _size_updated(
31653165
if layout:
31663166
self.virtual_size = virtual_size
31673167
else:
3168-
self._reactive_virtual_size = virtual_size
3168+
self.set_reactive(Widget.virtual_size, virtual_size)
31693169
self._container_size = container_size
31703170
if self.is_scrollable:
31713171
self._scroll_update(virtual_size)
@@ -3706,7 +3706,17 @@ def _on_scroll_right(self, event: ScrollRight) -> None:
37063706
self.scroll_page_right()
37073707
event.stop()
37083708

3709+
def _on_show(self, event: events.Show) -> None:
3710+
if self.show_horizontal_scrollbar:
3711+
self.horizontal_scrollbar.post_message(event)
3712+
if self.show_vertical_scrollbar:
3713+
self.vertical_scrollbar.post_message(event)
3714+
37093715
def _on_hide(self, event: events.Hide) -> None:
3716+
if self.show_horizontal_scrollbar:
3717+
self.horizontal_scrollbar.post_message(event)
3718+
if self.show_vertical_scrollbar:
3719+
self.vertical_scrollbar.post_message(event)
37103720
if self.has_focus:
37113721
self.blur()
37123722

0 commit comments

Comments
 (0)