HomePhabricator

Element: DWIM when repeatedly infusing the same node

Description

Element: DWIM when repeatedly infusing the same node

Infusing a node causes it to be removed from the DOM and replaced with
the infused widget's node. If anyone is holding a reference to it when
this happens, they're left with a useless unattached node, that can
confusingly be infused again, generating a new Widget every time,
similarly unattached and useless.

Let's do something smart and intuitive and return the original infused
widget when a previously-infused node is infused again. We already
have code to handle no-op OO.ui.infuse() on infused widgets' nodes,
so this is a one-line change.

Bug: T105828
Change-Id: I11fd1c7f2434f904b9ddc94b0903f8278e06f3a1

Details