Browse Source

Detach view from item when removed

pull/10351/head
Soheab 8 months ago
committed by GitHub
parent
commit
9580898c97
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      discord/ui/view.py

6
discord/ui/view.py

@ -439,6 +439,7 @@ class BaseView:
pass
else:
self._add_count(-item._total_count)
item._update_view(None)
return self
@ -448,6 +449,9 @@ class BaseView:
This function returns the class instance to allow for fluent-style
chaining.
"""
for child in self._children:
child._update_view(None)
self._children.clear()
self._total_children = 0
return self
@ -744,6 +748,8 @@ class View(BaseView):
pass
else:
self.__weights.remove_item(item)
item._update_view(None)
return self
def clear_items(self) -> Self:

Loading…
Cancel
Save