mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 17:28:01 +01:00
Fixed key events traversal for modal dialogs (#288)
The key must be propagated initially to the first chain element
before evaluating if we should stop because of the handled or
the Modal condition. Otherwise the modal dialog
won't get any process key notification.
This fixes c072e29a68
This commit is contained in:
committed by
Miguel de Icaza
parent
6944b755f5
commit
d0790712e5
@@ -1812,25 +1812,25 @@ namespace Terminal.Gui {
|
||||
{
|
||||
var chain = toplevels.ToList();
|
||||
foreach (var topLevel in chain) {
|
||||
if (topLevel.Modal)
|
||||
break;
|
||||
if (topLevel.ProcessHotKey (ke))
|
||||
return;
|
||||
if (topLevel.Modal)
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (var topLevel in chain) {
|
||||
if (topLevel.Modal)
|
||||
break;
|
||||
if (topLevel.ProcessKey (ke))
|
||||
return;
|
||||
if (topLevel.Modal)
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (var topLevel in chain) {
|
||||
if (topLevel.Modal)
|
||||
break;
|
||||
// Process the key normally
|
||||
if (topLevel.ProcessColdKey (ke))
|
||||
return;
|
||||
if (topLevel.Modal)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user