Fixes #9734 & #9713 - Only set focus on select field search boxes if the select is open #9735
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.