aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/templates/components/input-with-autocomplete.hbs
blob: 1a73c0748e47e0c156ff3bc60cb8b65fda7bfa0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<div class="input-group">
    {{input class="form-control search-input" value=query placeholder=placeholder}}
    <div class="autocomplete-container">
        {{# if items}}
            <ul class="autocomplete-items">
                {{#each items as |item index|}}
                    <li class="{{if (eq index highlightedItemIndex) "highlighted"}}" onclick={{action "goToDefinition" item}}>
                        <div class="autocomplete-item">
                            {{yield item}}
                        </div>
                    </li>
                {{/each}}
            </ul>
        {{/if}}
    </div>
    <div class="input-group-append">
        <button id="search-input" class="btn btn-outline-secondary" {{action "onSubmit" query}}>{{searchButtonText}}</button>
    </div>
</div>