@@ -122,6 +122,9 @@ chosen.
122
122
*/
123
123
func GetSelectionFromProportionalHorizontalMenu (layerAlias string , styleEntry memory.TuiStyleEntryType , selectionEntry memory.SelectionEntryType , xLocation int , yLocation int , menuWidth int , numberOfItemsOnRow int , defaultItemSelected int ) string {
124
124
selectionIndex := GetSelectionFromProportionalHorizontalMenuByIndex (layerAlias , styleEntry , selectionEntry , xLocation , yLocation , menuWidth , numberOfItemsOnRow , defaultItemSelected )
125
+ if selectionIndex == constants .NullSelectionIndex {
126
+ return ""
127
+ }
125
128
return selectionEntry .SelectionAlias [selectionIndex ]
126
129
}
127
130
@@ -207,6 +210,10 @@ func GetSelectionFromProportionalHorizontalMenuByIndex(layerAlias string, styleE
207
210
returnValue = selectedItem
208
211
isItemSelected = true
209
212
}
213
+ if currentKeyPressed == "esc" {
214
+ returnValue = constants .NullSelectionIndex
215
+ isItemSelected = true
216
+ }
210
217
if previouslySelectedItem != selectedItem {
211
218
if selectedItem >= len (selectionEntry .SelectionValue ) {
212
219
selectedItem = len (selectionEntry .SelectionValue ) - 1
@@ -237,6 +244,9 @@ chosen.
237
244
*/
238
245
func GetSelectionFromHorizontalMenu (layerAlias string , styleEntry memory.TuiStyleEntryType , selectionEntry memory.SelectionEntryType , xLocation int , yLocation int , defaultItemSelected int ) string {
239
246
selectionIndex := GetSelectionFromHorizontalMenuByIndex (layerAlias , styleEntry , selectionEntry , xLocation , yLocation , defaultItemSelected )
247
+ if selectionIndex == constants .NullSelectionIndex {
248
+ return ""
249
+ }
240
250
return selectionEntry .SelectionAlias [selectionIndex ]
241
251
}
242
252
@@ -297,6 +307,10 @@ func GetSelectionFromHorizontalMenuByIndex(layerAlias string, styleEntry memory.
297
307
returnValue = selectedItem
298
308
isItemSelected = true
299
309
}
310
+ if currentKeyPressed == "esc" {
311
+ returnValue = constants .NullSelectionIndex
312
+ isItemSelected = true
313
+ }
300
314
if previouslySelectedItem != selectedItem {
301
315
if selectedItem >= len (selectionEntry .SelectionValue ) {
302
316
selectedItem = len (selectionEntry .SelectionValue ) - 1
@@ -360,6 +374,9 @@ chosen.
360
374
*/
361
375
func GetSelectionFromVerticalMenu (layerAlias string , styleEntry memory.TuiStyleEntryType , selectionEntry memory.SelectionEntryType , xLocation int , yLocation int , menuWidth int , menuHeight int , defaultItemSelected int ) string {
362
376
selectionIndex := GetSelectionFromVerticalMenuByIndex (layerAlias , styleEntry , selectionEntry , xLocation , yLocation , menuWidth , menuHeight , defaultItemSelected )
377
+ if selectionIndex == constants .NullSelectionIndex {
378
+ return ""
379
+ }
363
380
return selectionEntry .SelectionAlias [selectionIndex ]
364
381
}
365
382
0 commit comments