Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot select option when bind data dynamic into nb-select #1063

Closed
tuannh2 opened this issue Dec 11, 2018 · 8 comments
Closed

Cannot select option when bind data dynamic into nb-select #1063

tuannh2 opened this issue Dec 11, 2018 · 8 comments
Assignees
Milestone

Comments

@tuannh2
Copy link

tuannh2 commented Dec 11, 2018

I'm using nb-select for my project, and when i bind data auto in nb-select, i cannot select option as below images:

image

image

my code in component:

"
import { Component } from '@angular/core';
import { NbMenuService } from '@nebular/theme';
import { TaxAuthorityService } from '../../@core/services/taxAuthority.service';

@component({
selector: 'ngx-organization',
styleUrls: ['organization.component.scss'],
templateUrl: 'organization.component.html',
})

export class OrganizationComponent {
taxAuthorities;

constructor(private menuService: NbMenuService, private taxAuthorityService: TaxAuthorityService) {
    //this.taxAuthorities = taxAuthorityService.getTaxAuthorities();
}

ngOnInit() {
    this.taxAuthorityService.getTaxAuthorities().subscribe(p=>this.taxAuthorities = p);
}

}
"

Thanks!

Tuan,

@gaspardip
Copy link

Its already fixed by #1009 but Nebular 3.0.1 is not complete yet

Duplicates: #948 #931

@Tibing Tibing closed this as completed Dec 13, 2018
@tanzeelrana
Copy link

is this fix released ?

@tuannh2
Copy link
Author

tuannh2 commented Dec 20, 2018

Thanks @tanzeelrana.

I already used the normal select control instead of nb-select.

Tuan,

@jaapcrezee
Copy link

jaapcrezee commented Feb 20, 2019

This does not seem fixed in Nebular v3.3.0. When I set my .ts property to = null and use data subscription and

  <nb-select *ngIf="items">
    <ng-container *ngFor="let item of items">
      <nb-option>{{ item }}</nb-option>
    </ng-container>
</nb-select>

there is no data in the dropdown select; <select/> works as expected.

@nnixaa nnixaa added this to the 3.4.0 milestone Feb 21, 2019
@nnixaa
Copy link
Collaborator

nnixaa commented Feb 21, 2019

@Tibing can you check?

@aefox
Copy link
Contributor

aefox commented Mar 6, 2019

the initially raised issue with selecting the option actually works as expected as long as your nb-options correctly set their value attribute. please see this stackblitz for examples. If you remove the [value]="item" on the nb-options you'll see the problem you mentioned reproduces. but this is an incorrect usage of nb-option. cc: @nnixaa maybe this needs better documentation?

In the second case when using an ng-container as wrapper for nb-options the problem is indeed reproducible on nebular 3.1.0 and 3.3.0. I already have a fix and currently writing some tests. Will raise PR today

@aefox
Copy link
Contributor

aefox commented Mar 6, 2019

PR raised

@sutra
Copy link

sutra commented Jul 8, 2019

It seems that, this issue can be reproduced in 3.0.0, and fixed in 3.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants