New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter fields on drop downs don't gain focus automatically #9632
Comments
I notice that Tags and Status behaves slightly differently from all other fields. Clicking Tags or Status instantly brings down the dropdown with no change to the "select status" field. Other fields like Region, Tenant, etc all briefly highlight the "select region" field before passing off to the "filter" input. so looks like those fields steal focus briefly before (probably) handing it off to the filter input. tags/status always auto-focuses for me, but all other fields intermittently do or don't auto-focus every time I click. On 3.1.2 / macOS Safari |
It works perfectly for me on v3.2.5 / Chrome Windows. |
I cannot replicate this on any of: Chrome (Windows), Firefox (Windows) and Safari (OS X). |
It seems to depend on how many objects you have in the database. A brand new empty installation has no issues, but as soon as we imported some 800 tenants, it directly occurs in the Tenant dropdown. |
I managed to replicate it using the throttle feature in chrome. So it happens when the API is slow to respond when the select field populates the data. The field is disabled when it's loading data, so slim-select sets the focus while the search field is disabled if the API is too slow to respond. Can be fixed by inserting: this.slim.slim.search.input.focus(); After line 413 here: netbox/netbox/project-static/src/select/api/apiSelect.ts Lines 405 to 416 in 29f6291
I don't have a time to test i properly right now. If anyone wants to test it properly and submit a PR, feel free. Otherwise I'll probably get to it at some point. |
@kkthxbye-code seems to have nailed it here - I'm using an instance hosted on another continent with reasonable latency loading select field items. While we don't have many field items, the loading time appears to be enough to trigger this. |
Fixes #9632 - Focus on select field after populating data
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. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary. |
NetBox version
v3.1.11
Python version
3.9
Steps to Reproduce
Expected Behavior
Like the "Status" and "Tags" filter fields that present a "search" input text box, all filtering text inputs should automatically gain keyboard focus for 0-click text entry.
Observed Behavior
The "filter" field text boxes remain unfocussed and require an additional mouse-click.
The text was updated successfully, but these errors were encountered: