fix(ui): keep a typed layer or style name when the field loses focus

Renaming a layer or a style was only applied on Enter; clicking anywhere
else dropped the typed name. A click that moves focus off a field whose
text changed now commits it. New and Copy in the style managers open the
generated name for renaming, so a new style can be named right away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-13 11:19:12 +03:00
1 parent 4639546472
commit f6503ad4d3
5 files changed
+93 -46

No files matched your search

+8 -1
View File
@@ -510,6 +510,13 @@ pub fn build_field_key_map(sections: &[PropSection]) -> HashMap<iced::widget::Id
/// the `WebFieldCopy` operation idiom: `focusable` fires for every focusable
/// widget, and we record the one that `is_focused()`.
pub fn sync_active_field_task() -> iced::Task<Message> {
focused_widget_task(Message::PropSyncActive)
}
/// Ask the widget tree which field holds keyboard focus.
pub fn focused_widget_task(
on_result: fn(Option<iced::advanced::widget::Id>) -> Message,
) -> iced::Task<Message> {
use iced::advanced::widget::operation::{Focusable, Outcome};
use iced::advanced::widget::{Id, Operation};
#[derive(Default)]
@@ -534,7 +541,7 @@ pub fn sync_active_field_task() -> iced::Task<Message> {
Outcome::Some(self.focused.clone())
}
}
iced::advanced::widget::operate(FocusedId::default()).map(Message::PropSyncActive)
iced::advanced::widget::operate(FocusedId::default()).map(on_result)
}
/// A translated choice label paired with the unchanged value stored in the