[PR #9735] [MERGED] Fixes #9734 & #9713 - Only set focus on select field search boxes if the select is open #13509

Closed
opened 2025-12-29 23:19:16 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/9735
Author: @kkthxbye-code
Created: 7/15/2022
Status: Merged
Merged: 7/15/2022
Merged by: @jeremystretch

Base: developHead: fix-9734


📝 Commits (1)

  • b0df24e UI: Only set focus on select field search boxes if the select is open

📊 Changes

3 files changed (+8 additions, -3 deletions)

View changed files

📝 netbox/project-static/dist/netbox.js (+1 -1)
📝 netbox/project-static/dist/netbox.js.map (+1 -1)
📝 netbox/project-static/src/select/api/apiSelect.ts (+6 -1)

📄 Description

Fixes: #9734 and #9713

This was caused by me missing that selecting fields like manufacturer would pre-load the dependant field (devicetype).

I have no idea if there's a smarter way of knowing if the select field is open. Checking for visibility in javascript seems like a nightmare, and I was unable to find a built-in property or method in slim-select that tells you if a select field is open.

I did try with this.slim.data.contentOpen, however it will return false when the select is in the process of opening, as it is only set on animation completion. Not sure if that is an actual issue though, as slim-select will set the focus correctly if the API returns fast.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/9735 **Author:** [@kkthxbye-code](https://github.com/kkthxbye-code) **Created:** 7/15/2022 **Status:** ✅ Merged **Merged:** 7/15/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `fix-9734` --- ### 📝 Commits (1) - [`b0df24e`](https://github.com/netbox-community/netbox/commit/b0df24e6d1fac3bf568bc29a16c5d7584032a6d3) UI: Only set focus on select field search boxes if the select is open ### 📊 Changes **3 files changed** (+8 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/project-static/dist/netbox.js` (+1 -1) 📝 `netbox/project-static/dist/netbox.js.map` (+1 -1) 📝 `netbox/project-static/src/select/api/apiSelect.ts` (+6 -1) </details> ### 📄 Description ### Fixes: #9734 and #9713 This was caused by me missing that selecting fields like manufacturer would pre-load the dependant field (devicetype). I have no idea if there's a smarter way of knowing if the select field is open. Checking for visibility in javascript seems like a nightmare, and I was unable to find a built-in property or method in slim-select that tells you if a select field is open. I did try with `this.slim.data.contentOpen`, however it will return false when the select is in the process of opening, as it is only set on animation completion. Not sure if that is an actual issue though, as slim-select will set the focus correctly if the API returns fast. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:19:16 +01:00
adam closed this issue 2025-12-29 23:19:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13509