Matching default multiple fields should also be case-insensitive

This commit is contained in:
Nyall Dawson 2017-09-22 12:02:48 +10:00
parent b4a798e892
commit b39459b8ff

View File

@ -1361,9 +1361,17 @@ class TableFieldWidgetWrapper(WidgetWrapper):
if self.param.allowMultiple():
options = self.widget.options
selected = []
for i, opt in enumerate(options):
if opt in value or opt == value:
selected.append(i)
if isinstance(value, str):
value = value.split(';')
for v in value:
for i, opt in enumerate(options):
if opt == v:
selected.append(i)
# case insensitive check - only do if matching case value is not present
elif v not in options and opt.lower() == v.lower():
selected.append(i)
self.widget.setSelectedItems(selected)
else:
self.widget.setField(value)