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`
|
- Removed `screen.visible_widgets` and `screen.widgets`
|
||||||
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Numbers in a descendant-combined selector no longer cause an error https://github.com/Textualize/textual/issues/1836
|
- 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
|
## [0.11.1] - 2023-02-17
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ from . import errors, events, messages
|
|||||||
from ._animator import DEFAULT_EASING, Animatable, BoundAnimator, EasingFunction
|
from ._animator import DEFAULT_EASING, Animatable, BoundAnimator, EasingFunction
|
||||||
from ._arrange import DockArrangeResult, arrange
|
from ._arrange import DockArrangeResult, arrange
|
||||||
from ._asyncio import create_task
|
from ._asyncio import create_task
|
||||||
from ._compose import compose
|
|
||||||
from ._cache import FIFOCache
|
from ._cache import FIFOCache
|
||||||
|
from ._compose import compose
|
||||||
from ._context import active_app
|
from ._context import active_app
|
||||||
from ._easing import DEFAULT_SCROLL_EASING
|
from ._easing import DEFAULT_SCROLL_EASING
|
||||||
from ._layout import Layout
|
from ._layout import Layout
|
||||||
@@ -1891,6 +1891,10 @@ class Widget(DOMNode):
|
|||||||
|
|
||||||
while isinstance(widget.parent, Widget) and widget is not self:
|
while isinstance(widget.parent, Widget) and widget is not self:
|
||||||
container = widget.parent
|
container = widget.parent
|
||||||
|
|
||||||
|
if widget.styles.dock:
|
||||||
|
scroll_offset = Offset(0, 0)
|
||||||
|
else:
|
||||||
scroll_offset = container.scroll_to_region(
|
scroll_offset = container.scroll_to_region(
|
||||||
region,
|
region,
|
||||||
spacing=widget.parent.gutter,
|
spacing=widget.parent.gutter,
|
||||||
|
|||||||
Reference in New Issue
Block a user