mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fix issue where ListView appeared detached from Screen
This commit is contained in:
@@ -259,7 +259,7 @@ class DOMNode(MessagePump):
|
||||
from .screen import Screen
|
||||
|
||||
node = self
|
||||
while node and not isinstance(node, Screen):
|
||||
while node is not None and not isinstance(node, Screen):
|
||||
node = node._parent
|
||||
if not isinstance(node, Screen):
|
||||
raise NoScreen("node has no screen")
|
||||
|
||||
@@ -85,7 +85,7 @@ class ListView(Vertical, can_focus=True, can_focus_children=False):
|
||||
|
||||
async def clear(self) -> None:
|
||||
"""Clear all items from the ListView."""
|
||||
|
||||
await self.query("ListView > ListItem").remove()
|
||||
await self.emit(self.ChildrenUpdated(self, self.children))
|
||||
|
||||
def action_select(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user