Focus on searchbar #5663

Closed
opened 2025-12-29 19:30:50 +01:00 by adam · 8 comments
Owner

Originally created by @PieterL75 on GitHub (Nov 16, 2021).

Originally assigned to: @PieterL75 on GitHub.

NetBox version

v3.0.10

Feature type

Change to existing functionality

Proposed functionality

When opening netbox, I always have to click in the searchbox, before I can type.

It would be easier if the searchbox already has focus by default.
Only when there is a form to be completed, then the first field of the form needs to have the focus

Use case

Less clicking

Database changes

None

External dependencies

None

Originally created by @PieterL75 on GitHub (Nov 16, 2021). Originally assigned to: @PieterL75 on GitHub. ### NetBox version v3.0.10 ### Feature type Change to existing functionality ### Proposed functionality When opening netbox, I always have to click in the searchbox, before I can type. It would be easier if the searchbox already has focus by default. Only when there is a form to be completed, then the first field of the form needs to have the focus ### Use case Less clicking ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 19:30:50 +01:00
adam closed this issue 2025-12-29 19:30:51 +01:00
Author
Owner

@sdktr commented on GitHub (Nov 16, 2021):

Makes sense, I'm a big fan of having netbox as a search provider in my browser.

When url bar has focus:
netbox router

Opens search result for 'router'

@sdktr commented on GitHub (Nov 16, 2021): Makes sense, I'm a big fan of having netbox as a search provider in my browser. When url bar has focus: netbox <tab> router Opens search result for 'router'
Author
Owner

@DanSheps commented on GitHub (Nov 17, 2021):

I don't think there is anything in here that enables netbox as a search provider in the browser

@DanSheps commented on GitHub (Nov 17, 2021): I don't think there is anything in here that enables netbox as a search provider in the browser
Author
Owner

@PieterL75 commented on GitHub (Nov 17, 2021):

Just to clear my request. I don't want a search provider.. I just want to have the search field gets the focus when I open Netbox....

And you can easily add a search provider in modern browsers manually..
net -> https://netbox?q=%s

@PieterL75 commented on GitHub (Nov 17, 2021): Just to clear my request. I don't want a search provider.. I just want to have the search field gets the focus when I open Netbox.... And you can easily add a search provider in modern browsers manually.. net -> https://netbox?q=%s
Author
Owner

@github-actions[bot] commented on GitHub (Jan 17, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jan 17, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@PieterL75 commented on GitHub (Mar 14, 2022):

@jeremystretch I volunteer to take a shot at this and #8813

@PieterL75 commented on GitHub (Mar 14, 2022): @jeremystretch I volunteer to take a shot at this and #8813
Author
Owner

@PieterL75 commented on GitHub (Mar 16, 2022):

All attempts to use 'autofocus' failed.
Seems that #7001 (by @thatmattlove) introduced a JS that set the focus to the content-container. If remove that focus, then the autofocus on the input field works perfect....
Now I have to think of a way to only focus on the content-container if no other fields have focus...

Setting the focus on the searchbar will interfere with that user wanting to scroll with the keys after a search..
Any good ideas ? eventhandlers that catch the up/down key and scroll, even when in the searchbar focus ?

@PieterL75 commented on GitHub (Mar 16, 2022): All attempts to use 'autofocus' failed. Seems that #7001 (by @thatmattlove) introduced a JS that set the focus to the content-container. If remove that focus, then the autofocus on the input field works perfect.... Now I have to think of a way to only focus on the content-container if no other fields have focus... Setting the focus on the searchbar will interfere with that user wanting to scroll with the keys after a search.. Any good ideas ? eventhandlers that catch the up/down key and scroll, even when in the searchbar focus ?
Author
Owner

@adamboutcher commented on GitHub (Jun 24, 2022):

Topics in this thread are linked to this: https://github.com/netbox-community/netbox/issues/9589

@adamboutcher commented on GitHub (Jun 24, 2022): Topics in this thread are linked to this: https://github.com/netbox-community/netbox/issues/9589
Author
Owner

@PieterL75 commented on GitHub (Jun 24, 2022):

This FR got a little hijacked.
The initial ask, was to put the focus on the searchbar of netbox after a search.
nothing to do with search providers or anything else.

I have a version running for myself, and in the end it is not that practical. It sometimes jumps to that focus, while a form wants the focus.

I'm going to cancel this FR

@PieterL75 commented on GitHub (Jun 24, 2022): This FR got a little hijacked. The initial ask, was to put the focus on the searchbar of netbox after a search. nothing to do with search providers or anything else. I have a version running for myself, and in the end it is not that practical. It sometimes jumps to that focus, while a form wants the focus. I'm going to cancel this FR
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5663