-
How to set focus programmatically. |
Beta Was this translation helpful? Give feedback.
Answered by
sa-si-dev
Nov 13, 2021
Replies: 2 comments 1 reply
-
@jgracia Please use the below function to focus programmatically. I will add a dedicated method in the plugin itself in the future release. focusVirtualSelect('sample-select');
function focusVirtualSelect(id) {
var $ele = document.querySelector('#' + id);
if ($ele) {
var $wrapper = $ele.querySelector('.vscomp-ele-wrapper');
if ($wrapper) {
$wrapper.focus();
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
@jgracia focus() method has been added in the release v1.0.19 It could be used as below. document.querySelector('#sample-select').focus(); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sa-si-dev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jgracia focus() method has been added in the release v1.0.19
It could be used as below.