From 916bb2260a2bdedd51ea3ebab24a20ce657c0d7c Mon Sep 17 00:00:00 2001 From: Conrad Hilley Date: Fri, 18 Feb 2022 14:19:12 -0800 Subject: [PATCH] Allow filterable dropdown to accept non-require --- gooey/gui/components/widgets/dropdown_filterable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gooey/gui/components/widgets/dropdown_filterable.py b/gooey/gui/components/widgets/dropdown_filterable.py index 4babdf1b..3b5234bf 100644 --- a/gooey/gui/components/widgets/dropdown_filterable.py +++ b/gooey/gui/components/widgets/dropdown_filterable.py @@ -105,7 +105,7 @@ def getWidget(self, parent, *args, **options): self.listbox.OnGetItem = self.OnGetItem # model is created here because the design of these widget # classes is broken. - self.model = FilterableDropdownModel(self._meta['choices'], self._options, listeners=[self.interpretState]) + self.model = FilterableDropdownModel(self._options.get('choices', []) or self._meta['choices'], self._options, listeners=[self.interpretState]) # overriding this to false removes it from tab behavior. # and keeps the tabbing at the top-level widget level self.listbox.AcceptsFocusFromKeyboard = lambda *args, **kwargs: False