fix: a credential or host-key prompt takes Enter and Escape from the modals underneath
Every modal read Enter/Escape globally, so a prompt that popped up over a dialog, the palette, Quick Connect or an SFTP dialog could be answered and the modal underneath confirmed or dismissed by the same key press. All modals except the prompts now read those keys through chrome::modal_key, which yields while a prompt is on screen.
This commit is contained in:
@@ -772,8 +772,8 @@ impl Sftp {
|
||||
return;
|
||||
};
|
||||
let t = Tokens::get(ctx);
|
||||
let esc = ctx.input(|i| i.key_pressed(Key::Escape));
|
||||
let enter = ctx.input(|i| i.key_pressed(Key::Enter));
|
||||
let esc = crate::chrome::modal_key(ctx, Key::Escape);
|
||||
let enter = crate::chrome::modal_key(ctx, Key::Enter);
|
||||
let mut keep = !esc;
|
||||
match &mut d {
|
||||
Dialog::Input { session, kind, value } => {
|
||||
@@ -961,7 +961,7 @@ impl Sftp {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ctx.input(|i| i.key_pressed(Key::Enter)) && writable && !target.is_empty() {
|
||||
if crate::chrome::modal_key(ctx, Key::Enter) && writable && !target.is_empty() {
|
||||
chosen = Some(target.clone());
|
||||
}
|
||||
if back && pk.filter.is_empty() && !pk.cwd.is_empty() && pk.cwd != "/" {
|
||||
|
||||
Reference in New Issue
Block a user