Skip to content

No hook (i.e. none of selected, autocomplete or cursorchange fired) if user types in exact match #33

Open
@aholland

Description

@aholland

I have bloodhound configured to fetch Json data, which it does very nicely.

   // constructs the suggestion engine
    var bloodHound = new Bloodhound({
        datumTokenizer: Bloodhound.tokenizers.whitespace,
        queryTokenizer: Bloodhound.tokenizers.whitespace,
        remote: {
            url: 'http://localhost:9000/invoices%QUERY',
            wildcard: '%QUERY'
        }
    });

In addition, the three main custom events are bound to the function "handler".

    ta.bind("typeahead:cursorchange", handler);
    ta.bind("typeahead:autocomplete", handler);
    ta.bind("typeahead:select", handler);

So almost everything works: if the user types in a string that matches part of a result and completes using tab, the autocomplete event fires and the correct item is selected. If the user uses the arrow keys or the mouse to select from the dropdown, that works. Even if the user types in the whole string matching a result but in the wrong case, and then presses tab, it works. BUT if the user types in a string that precisely matches the result, no event is fired and there is no direct way that I can find to get the data from the matching Json result into the form. I think this is a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions