From ef7de846712932ef167db5ee81b62d20f4d418e1 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 2 Apr 2021 17:57:59 +0800 Subject: [PATCH] bugfix --- kivyblocks/widgetExt/inputext.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kivyblocks/widgetExt/inputext.py b/kivyblocks/widgetExt/inputext.py index 9f4f0cc..63153d0 100755 --- a/kivyblocks/widgetExt/inputext.py +++ b/kivyblocks/widgetExt/inputext.py @@ -191,6 +191,7 @@ class MyDropDown(DropDown): return '' def setData(self,data): + Logger.info('TextInput: setData data=%s', data) self.si_data = data self.clear_widgets() h = self.options.get('height',2.5) @@ -199,8 +200,10 @@ class MyDropDown(DropDown): a['height'] = CSize(h) a['font_size'] = CSize(self.options.get('font_size',1)) for d in data: - dd = (d[self.valueField],d[self.textField]) - b = Button(text=d[self.textField],**a) + v = d.get(self.valueField, None) + t = d.get(self.textField, None) + dd = (v,t or v) + b = Button(text=dd[1],**a) setattr(b,'kw_data',dd) b.bind(on_release=lambda btn: self.select(btn.kw_data)) self.add_widget(b)