component preview: Focus search input immediately upon opening (#29155)
Just a quick quality of life improvement to make keyboard navigation in this view a bit better. When you open the Component Preview view now, the "filter" search input will be focused right off the bat. Release Notes: - N/A
This commit is contained in:
parent
333de5d673
commit
9a3434efb4
1 changed files with 8 additions and 2 deletions
|
@ -166,6 +166,9 @@ impl ComponentPreview {
|
|||
|
||||
component_preview.update_component_list(cx);
|
||||
|
||||
let focus_handle = component_preview.filter_editor.read(cx).focus_handle(cx);
|
||||
window.focus(&focus_handle);
|
||||
|
||||
component_preview
|
||||
}
|
||||
|
||||
|
@ -779,10 +782,13 @@ impl Item for ComponentPreview {
|
|||
fn added_to_workspace(
|
||||
&mut self,
|
||||
workspace: &mut Workspace,
|
||||
_window: &mut Window,
|
||||
_cx: &mut Context<Self>,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
self.workspace_id = workspace.database_id();
|
||||
|
||||
let focus_handle = self.filter_editor.read(cx).focus_handle(cx);
|
||||
window.focus(&focus_handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue