How can I set a value externally in the Select Dropdown?
Case
I have a select list of items A, B and C. And through a button I want the selected item to be item C.
How can I change the value selected outside the SelectDropdown element?
Thanks in advance!
if you are asking to set a default value you can use defaultValue, If you are asking for a method that you can call it by using the ref, It's not implemented yet I think it's an important feature to be added I'll work on it.
if you are asking to set a default value you can use
defaultValue, If you are asking for a method that you can call it by using the ref, It's not implemented yet I think it's an important feature to be added I'll work on it.
Hi Adel! Yes, I'm asking for a method that I can call it using a ref. Not the defaultValue.
I achieved that feature with #72.
selectIndex(index) this function is added in v3.0.0 to select an option from outside the component using a ref
Great! Thanks @AdelRedaa97 🎉
Also, I suggest you to add your comment in the Methods table in README.md (like with reset()).