Fix default value idx in `_determine_cursor_pos()` (#1800)
Co-authored-by: Daniel Girtler <blackrabbit256@gmail.com> Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
This commit is contained in:
parent
232939e910
commit
a968dccbf1
|
|
@ -337,7 +337,10 @@ class Menu(TerminalMenu):
|
||||||
if '|' in p:
|
if '|' in p:
|
||||||
p = p.replace('|', '\\|')
|
p = p.replace('|', '\\|')
|
||||||
|
|
||||||
idx = self._menu_options.index(p)
|
if p in self._menu_options:
|
||||||
|
idx = self._menu_options.index(p)
|
||||||
|
else:
|
||||||
|
idx = self._menu_options.index(self._default_menu_value)
|
||||||
indexes.append(idx)
|
indexes.append(idx)
|
||||||
except (IndexError, ValueError):
|
except (IndexError, ValueError):
|
||||||
log(f'Error finding index of {p}: {self._menu_options}', level=logging.DEBUG)
|
log(f'Error finding index of {p}: {self._menu_options}', level=logging.DEBUG)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue