diff --git a/src/browser/main/tab.rs b/src/browser/main/tab.rs index 8f52e426..96f6f757 100644 --- a/src/browser/main/tab.rs +++ b/src/browser/main/tab.rs @@ -75,7 +75,7 @@ impl Tab { let label = Arc::new(Label::new(id.clone(), false)); let page = Arc::new(Page::new( id.clone(), - page_navigation_request_text, + page_navigation_request_text.clone(), self.action_tab_page_reload.clone(), self.action_update.clone(), )); @@ -109,6 +109,10 @@ impl Tab { self.widget.set_current_page(Some(page_number)); } + if page_navigation_request_text.is_none() { + page.grab_navigation_request_focus(); + } + // Result page_number } diff --git a/src/browser/main/tab/page.rs b/src/browser/main/tab/page.rs index 782a035b..44af7c01 100644 --- a/src/browser/main/tab/page.rs +++ b/src/browser/main/tab/page.rs @@ -105,6 +105,10 @@ impl Page { } // Actions + pub fn grab_navigation_request_focus(&self) { + self.navigation.grab_request_focus(); + } + pub fn reload(&self) { // Init globals let request_text = self.navigation.request_text(); diff --git a/src/browser/main/tab/page/navigation.rs b/src/browser/main/tab/page/navigation.rs index eb4ac265..3054fbb9 100644 --- a/src/browser/main/tab/page/navigation.rs +++ b/src/browser/main/tab/page/navigation.rs @@ -75,6 +75,10 @@ impl Navigation { } // Actions + pub fn grab_request_focus(&self) { + self.request.widget().grab_focus(); + } + pub fn update(&self, progress_fraction: Option) { self.base.update(self.request.uri()); self.history.update();