Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed visual glitches and crash when changing `DataTable.header_height` https://github.com/Textualize/textual/pull/6128
- Fixed TextArea.placeholder not handling multi-lines https://github.com/Textualize/textual/pull/6138
- Fixed issue with RichLog when App.theme is set early https://github.com/Textualize/textual/pull/6141
- Fixed children of collapsible not being focusable after collapsible is expanded https://github.com/Textualize/textual/pull/6143

## [6.1.0] - 2025-08-01

Expand Down
6 changes: 6 additions & 0 deletions src/textual/css/_style_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,12 @@ def __set__(self, obj: StylesBase, value: EnumType | None = None):
children=self._refresh_children,
parent=self._refresh_parent,
)

if self._display:
node = obj.node
if node is not None and node.parent:
node._nodes.updated()

else:
if value not in self._valid_values:
raise StyleValueError(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions tests/snapshot_tests/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -4675,3 +4675,18 @@ def on_ready(self) -> None:
log_widget.write("Hello, World!")

assert snap_compare(TestApp())


def test_collapsible_focus_children(snap_compare) -> None:
"""Regression test for https://github.com/Textualize/textual/issues/6140

You should see an expanded collapsible containing a button. The button should be focused.

"""

class CollapseApp(App):
def compose(self) -> ComposeResult:
with Collapsible(title="Collapsible", collapsed=False):
yield Button("Hello")

assert snap_compare(CollapseApp(), press=["enter", "enter", "tab"])
Loading