Skip to content

onConfirm function is triggered before the auto selected option is set as the value of the input #157

Open
@davehaigh

Description

@davehaigh
  1. use a combination of autoselect: true and an onconfirm function which triggers the submit of the form.
  2. type some content into the input e.g. if you typed "Dav"
  3. hit return to autoselect the highlighted option e.g. it may have been "Dave Haigh"
  4. if you're using the entered value of the input to populate the value of the input on next load then the page reloads with only the typed value (Dav) in the input rather than the full text of the item that was autoselected (Dave Haigh)

I believe the onconfirm function is triggering before the autoselected value is set as the value of the input.

Note: To get around this I am using a set timeout in the onconfirm function to delay its triggering, allowing time for the value to be set in the input before it fires the form submit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted🐛 bugSomething isn't working the way it should (including incorrect wording in documentation)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions