How to reset Autocomplete field ?

UI Components for React
Post Reply
RyanKwan
Posts: 10
Joined: 17 Jan 2017, 11:20

19 Sep 2017, 05:44

May I ask how to reset a AutoComplete field? I tried the React this.setState() but failed. Seems I can only reset it by calling AutoComplete.writeValue(). Could you suggest what's the best way to do that?

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

19 Sep 2017, 10:25

Fixed for next version. Thanks a lot!
https://github.com/primefaces/primereact/issues/101

RyanKwan
Posts: 10
Joined: 17 Jan 2017, 11:20

19 Sep 2017, 11:32

Thx for the reply. I checked your fix, should it be writeValue(nextProps.value) so that we can define the default? Otherwise it can only reset to blank.

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

19 Sep 2017, 11:39

Opppss!! Thanks a lot for the fix. I added it to the new version.

joshdanhall
Posts: 8
Joined: 09 Sep 2016, 07:13

05 Dec 2017, 07:31

Would you please provide a code sample? i.e Not sure how to get a handle to the Autocomplete object to then call writeValue().

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

05 Dec 2017, 19:35

I see the issue and created;

https://github.com/primefaces/primereact/issues/220

Fixed for tomorrow's 1.3.0-RC1

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests