mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #1851 from Textualize/markdown-viewer-fix
don't scroll to docked widgets
This commit is contained in:
@@ -24,11 +24,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
- Removed `screen.visible_widgets` and `screen.widgets`
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Numbers in a descendant-combined selector no longer cause an error https://github.com/Textualize/textual/issues/1836
|
||||
|
||||
- Fixed superfluous scrolling when focusing a docked widget https://github.com/Textualize/textual/issues/1816
|
||||
|
||||
## [0.11.1] - 2023-02-17
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ from . import errors, events, messages
|
||||
from ._animator import DEFAULT_EASING, Animatable, BoundAnimator, EasingFunction
|
||||
from ._arrange import DockArrangeResult, arrange
|
||||
from ._asyncio import create_task
|
||||
from ._compose import compose
|
||||
from ._cache import FIFOCache
|
||||
from ._compose import compose
|
||||
from ._context import active_app
|
||||
from ._easing import DEFAULT_SCROLL_EASING
|
||||
from ._layout import Layout
|
||||
@@ -1891,18 +1891,22 @@ class Widget(DOMNode):
|
||||
|
||||
while isinstance(widget.parent, Widget) and widget is not self:
|
||||
container = widget.parent
|
||||
scroll_offset = container.scroll_to_region(
|
||||
region,
|
||||
spacing=widget.parent.gutter,
|
||||
animate=animate,
|
||||
speed=speed,
|
||||
duration=duration,
|
||||
top=top,
|
||||
easing=easing,
|
||||
force=force,
|
||||
)
|
||||
if scroll_offset:
|
||||
scrolled = True
|
||||
|
||||
if widget.styles.dock:
|
||||
scroll_offset = Offset(0, 0)
|
||||
else:
|
||||
scroll_offset = container.scroll_to_region(
|
||||
region,
|
||||
spacing=widget.parent.gutter,
|
||||
animate=animate,
|
||||
speed=speed,
|
||||
duration=duration,
|
||||
top=top,
|
||||
easing=easing,
|
||||
force=force,
|
||||
)
|
||||
if scroll_offset:
|
||||
scrolled = True
|
||||
|
||||
# Adjust the region by the amount we just scrolled it, and convert to
|
||||
# it's parent's virtual coordinate system.
|
||||
|
||||
Reference in New Issue
Block a user