Don't remove a widget from display before actual removal

This change ensures that, for example, the widget remains in the
Screen.focus_chain so that it's easier to handle passing off focus on
removal.

To help address #939.
This commit is contained in:
Dave Pearson
2022-10-19 10:44:44 +01:00
parent 3c4f0129ec
commit 728d1a5454

View File

@@ -1775,7 +1775,6 @@ class Widget(DOMNode):
def remove(self) -> None:
"""Remove the Widget from the DOM (effectively deleting it)"""
self.display = False
self.app.post_message_no_wait(events.Remove(self, widget=self))
def render(self) -> RenderableType: