Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.
This repository was archived by the owner on May 21, 2025. It is now read-only.

Using arrows may leave inconsistent value in the input field #521

Description

@marcelosramos

Hi again,

I have this other issue when navigating with the arrow keys: given I enter the input for the first time and I go down with the arrow down key, when I go back all the way up with the up key (until currentIndex gets to -1), then the value of the input do not clear out, it keeps the first item's value. So I see a value in the input field, but the selectedObject does not reflect that, I can't even catch it from the input-change function.

If I've typed in anything or selected any item before (even if I delete it all and set the input field to empty again), then the behaviour is what I expect, when I get all the way up, the input value goes back to what was there before.

This issue happens because of this code in line 397: inputField.val(scope.searchStr);. If I didn't type anything then scope.searchStr is undefined, and input.val(undifined) just doesn't do anything.

So, if scope.searchStr is previously initialised with null or '', or the line is replaced with inputField.val(scope.searchStr || '');, then the problem is solved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions