mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-12 18:13:10 +03:00
treeview: If cancelling empty search, drop focus
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
1a836c9bc4
commit
18c10ea706
@ -915,6 +915,12 @@ static void treeview__search_cancel(treeview *tree, bool drop_focus)
|
||||
return;
|
||||
}
|
||||
|
||||
if (textarea_get_text(tree->search.textarea, NULL, 0) == 1) {
|
||||
// If there's no text in the search box, we drop focus on a
|
||||
// cancel. Note '1' because it includes the trailing \0
|
||||
drop_focus = true;
|
||||
}
|
||||
|
||||
if (drop_focus) {
|
||||
tree->search.active = false;
|
||||
textarea_set_caret(tree->search.textarea, -1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user