Skip to content

Conversation

@kkthxbye-code
Copy link
Contributor

@kkthxbye-code kkthxbye-code commented Jul 15, 2022

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.

@kkthxbye-code kkthxbye-code changed the title Fixes #9734 - Only set focus on select field search boxes if the select is open Fixes #9734 & #9713 - Only set focus on select field search boxes if the select is open Jul 15, 2022
@jeremystretch
Copy link
Member

Thanks for jumping on this so quickly!

@jeremystretch jeremystretch merged commit b9dd654 into netbox-community:develop Jul 15, 2022
kkthxbye-code added a commit to kkthxbye-code/netbox that referenced this pull request Jul 17, 2022
jeremystretch added a commit that referenced this pull request Jul 18, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Other select fields steal focus if the choice filters other select fields (caused by #9632)

2 participants