Page 1 of 1

Editable dropdown onChange focus

Posted: 06 Jun 2019, 00:32
by tmorse
Trying to create an editable dropdown component using prime reacts dropdown.

I want to update state with the new e.value each keystroke, only problem with this is it loses focus of the dropdown everytime.
There is a way to create a reference to the dropdown, but no focus() function available.

Is there another way to handle setting the state of value without losing focus or another function I can use to keep the focus on the editable dropdown input field to allow a user to keep typing?

Using the dropdown extends React.Component structure.

Re: Editable dropdown onChange focus

Posted: 24 Jun 2019, 10:18
by mert.sincan
Hi,

I couldn't replicate it. Could you please attach a codesandbox link for us to replicate?

Also, maybe you can use the onEditableInputFocus method of dropdown. Exp;

Code: Select all

this.dd.onEditableInputFocus();
...
<Dropdown ref={(el) => this.dd = el} ...
Best Regards,