ejmudi/react-autocomplete-hint

Double hint-click

Closed this issue · 0 comments

Describe the bug
Clicking hint causes text to be filled incorrectly.
The issue is due to unmodifiedText not being set after a hint is clicked and filled inside of handleOnFill() inside of index.ts.

To Reproduce

  1. Enter text into text box wrapped with Hint with options ['banana', 'banana!123']
  2. Type the letters 'banan'
  3. Click on autocomplete hint for 'banana'
  4. Click on the new hint for 'banana!123'
  5. Textbox text is now replaced with 'a!123' incorrectly

Expected behavior
When clicking on hints it will add to the text in the textbox correctly.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Electron 17.0.1