Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ use cosmic::{
keyboard::{Event as KeyEvent, Key, Modifiers},
mouse, stream, window, Alignment, Event, Length, Point, Size, Subscription,
},
iced_core::widget::operation,
theme,
widget::{
self,
menu::{key_bind::Modifier, Action as MenuAction, KeyBind},
segmented_button,
segmented_button, Operation,
},
Application, ApplicationExt, Element,
};
Expand Down Expand Up @@ -1177,6 +1178,14 @@ impl Application for App {
return Task::none();
}

// Close the dialog if the focused widget is the dialog's main text input instead of
// unfocussing the widget.
if let operation::Outcome::Some(focused) = operation::focusable::find_focused().finish() {
if self.dialog_text_input == focused {
return self.update(Message::Cancel);
}
}

self.update(Message::Cancel)
}

Expand Down