mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Tell AccessKit that the default action for a text edit (equivalent to a click) is to set the focus. This matters to some platform adapters.
This commit is contained in:
@@ -552,7 +552,7 @@ impl Response {
|
||||
if self.sense.focusable {
|
||||
node.focusable = true;
|
||||
}
|
||||
if self.sense.click {
|
||||
if self.sense.click && node.default_action_verb.is_none() {
|
||||
node.default_action_verb = Some(accesskit::DefaultActionVerb::Click);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,8 +719,9 @@ impl<'t> TextEdit<'t> {
|
||||
node.word_lengths = word_lengths.into();
|
||||
}
|
||||
|
||||
let mut node = ui.ctx().accesskit_node(parent_id, None);
|
||||
|
||||
if let Some(cursor_range) = &cursor_range {
|
||||
let mut node = ui.ctx().accesskit_node(parent_id, None);
|
||||
let anchor = &cursor_range.secondary.rcursor;
|
||||
let focus = &cursor_range.primary.rcursor;
|
||||
node.text_selection = Some(TextSelection {
|
||||
@@ -734,6 +735,8 @@ impl<'t> TextEdit<'t> {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
node.default_action_verb = Some(accesskit::DefaultActionVerb::Focus);
|
||||
}
|
||||
|
||||
TextEditOutput {
|
||||
|
||||
Reference in New Issue
Block a user