Skip to content

Wildcard in remote not working #1720

@thany

Description

@thany

If I use this:

new Bloodhound({
    limit: 6,
    datumTokenizer: Bloodhound.tokenizers.obj.whitespace("value"),
    queryTokenizer: Bloodhound.tokenizers.whitespace,
    remote: "/suggest?search_term=%QUERY"
})

Then on performing a search, typeahead will literally do a GET /suggest?search_term=%QUERY. In other words, the placeholder %QUERY is not replaced with whatever the user typed in.

This I consider a regression, because it worked fine in version 0.10.x, and there is no migration document for 0.10->0.11.

There is no documentation on this either. It nowhere says what the default placeholder is, i.e. what the remote option ouhta look like. The source suggests that if neither the replace nor the wildcard option is provided in remote when it is an object, the url will be used as-is. But I couldn't find how it behaves when remote is a string instead of an object.

I would expect some default wildcard to be used.
So what has the default wildcard become in version 0.11?

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