We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b76ab32 commit f37ef38Copy full SHA for f37ef38
arcade/gui/widgets/dropdown.py
@@ -28,7 +28,8 @@ def show(self, manager: UIManager):
28
29
def hide(self):
30
"""Hide the overlay."""
31
- self.parent.remove(self)
+ if self.parent:
32
+ self.parent.remove(self)
33
34
def on_event(self, event: UIEvent) -> Optional[bool]:
35
if isinstance(event, UIMousePressEvent):
@@ -164,8 +165,8 @@ def _on_button_click(self, _: UIOnClickEvent):
164
165
166
def _on_option_click(self, event: UIOnClickEvent):
167
source: UIFlatButton = event.source
- self.value = source.text
168
self._overlay.hide()
169
+ self.value = source.text
170
171
def do_layout(self):
172
"""Position the overlay, this is not a common thing to do in do_layout,
0 commit comments