mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-12-04 03:37:17 +00:00
Fixed bug - If we move the cursor from a line that has dissapear
This commit is contained in:
parent
975c1a37d9
commit
75b4037519
1 changed files with 1 additions and 0 deletions
|
@ -117,6 +117,7 @@ class CListBox(ListBox):
|
||||||
if len(self._options) > 0 and event.key_code == Screen.KEY_UP:
|
if len(self._options) > 0 and event.key_code == Screen.KEY_UP:
|
||||||
# Move up one line in text - use value to trigger on_select.
|
# Move up one line in text - use value to trigger on_select.
|
||||||
self._line = max(0, self._line - 1)
|
self._line = max(0, self._line - 1)
|
||||||
|
self._line = min(self._line, len(self._options)-1) #If we move a line cursor from a line that has dissapear
|
||||||
self.value = self._options[self._line][1]
|
self.value = self._options[self._line][1]
|
||||||
|
|
||||||
elif len(self._options) > 0 and event.key_code == Screen.KEY_DOWN:
|
elif len(self._options) > 0 and event.key_code == Screen.KEY_DOWN:
|
||||||
|
|
Loading…
Reference in a new issue