From e55ee23eae5b9ae940eecc2d42d70188eec0fc48 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 1 Jun 2023 10:49:29 +0100 Subject: [PATCH] Defer the repainting of the node in the tree The previous change actually broke some of the tests in test_disabled.py -- well actually it flat out broke one and caused all the others to run *very* slowly. No clue why though. But thinking about this some more, it does feel like delaying the refresh of the node makes more sense. --- src/textual/widgets/_tree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textual/widgets/_tree.py b/src/textual/widgets/_tree.py index 83d322905..f4c218cb9 100644 --- a/src/textual/widgets/_tree.py +++ b/src/textual/widgets/_tree.py @@ -307,7 +307,7 @@ class TreeNode(Generic[TreeDataType]): self._updates += 1 text_label = self._tree.process_label(label) self._label = text_label - self._tree._refresh_node(self) + self._tree.call_later(self._tree._refresh_node, self) def add( self,