Skip to content

Commit

Permalink
Don't remove a widget from display before actual removal
Browse files Browse the repository at this point in the history
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 Textualize#939.
  • Loading branch information
davep committed Oct 19, 2022
1 parent 3c4f012 commit 728d1a5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,6 @@ def refresh(

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:
Expand Down

0 comments on commit 728d1a5

Please sign in to comment.