Editable dropdown onChange focus

UI Components for React
Post Reply
tmorse
Posts: 1
Joined: 05 Jun 2019, 23:43

06 Jun 2019, 00:32

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.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

24 Jun 2019, 10:18

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,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests