question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Input not closing on selection?

See original GitHub issue

Please fill below information if issuing a bug report.

Expected behaviour

When I use the typeahead or standard dropdown menu, upon selecting an option, I would expect the input to close unless multiple = true.

Actual behaviour

Upon selecting an option, the dropdown menu stays open.

More Info

ng-select version: 0.6.1

browser: chrome

reproducible in demo page: no

Is there anything that would cause such behavior from occurring?

<ng-select formControlName="requestor" [items]="employees" bindLabel="NTID" placeholder="Search Employees" typeToSearchText="Enter 2 characters to begin your search.."
    notFoundText="No employee records found" [typeahead]="typeahead" [clearable]="false" [(ngModel)]="employeeModel">
    <ng-template ng-label-tmp let-item="item">
        {{ item.FirstName + ' ' + item.LastName + ' ('+item.NTID+')'}}
    </ng-template>
    <ng-template ng-option-tmp let-item="item">
        <div class="row">
            <div class="col-md-1 peopleSearchPic">
                <img src="{{ PhotoURL }}{{item.QID}}.jpg" width="35px" height="45px">
            </div>
            <div class="col-md-11">
                {{ item.FirstName + ' ' + item.LastName }}
                <div class="row">
                    <div class="col-md-12">
                        <span class="smallText">NTID: {{ item.NTID }} | Location: {{ item.CenterName }}</span>
                    </div>
                </div>
            </div>
        </div>
    </ng-template>
</ng-select>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
clark0xcommented, Nov 21, 2017

my fix, works for me:

<ng-select ... #thisSelect (blur)="thisSelect.close()"></ng-select>
0reactions
iamsrujalcommented, May 1, 2020

my fix, works for me:

<ng-select ... #thisSelect (blur)="thisSelect.close()"></ng-select>

this solution works for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preventing close of select input on selection in React
According to this answer, it's not really possible with a native <select> element—at least not quite like you'd expect.
Read more >
Dropdown is not getting close in the Lightning Input box in LWC
Hi I have created the lightning input box which contains some value as a drop down but when i am clicking outside of...
Read more >
Search Material Select closing dropdown on search input clic
Actual behavior When clicking into the input field on the searchable select box, the dropdown treats the click as if it is not...
Read more >
closing input tags with /> or just >??? - Codecademy
The exercise (Getting Input Section 2 Pt 2) says they should close with a /> but each one I see closes without the...
Read more >
Select - Ant Design
The height of the input field for the select defaults to 32px. ... When I click elements in dropdownRender, the select dropdown will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found