mirror of https://github.com/kivy/kivy.git
Merge pull request #3672 from ngoonee/patch-2
Maintain last selection if not allowing empty selection
This commit is contained in:
commit
089f73630d
|
@ -299,7 +299,14 @@ class ListAdapter(Adapter, EventDispatcher):
|
|||
else:
|
||||
self.select_item_view(view)
|
||||
else:
|
||||
self.deselect_item_view(view)
|
||||
if len(self.selection) == 1 and not self.allow_empty_selection:
|
||||
# Maintain selection rather than always defaulting to first
|
||||
# item. This probably invalidates the next if section, but I
|
||||
# am unable to test all corner cases out, and leaving it in
|
||||
# does not hurt anything.
|
||||
pass
|
||||
else:
|
||||
self.deselect_item_view(view)
|
||||
if self.selection_mode != 'none':
|
||||
# If the deselection makes selection empty, the following call
|
||||
# will check allows_empty_selection, and if False, will
|
||||
|
|
Loading…
Reference in New Issue