-
-
Notifications
You must be signed in to change notification settings - Fork 902
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
destroy dropdown panel on close #286
Conversation
(empty && this._isTypeahead && this.filterValue && !this.isLoading); | ||
return ((empty && !this._isTypeahead && !this.loading) || | ||
(empty && this._isTypeahead && this.filterValue && !this.isLoading)) && | ||
!this.showAddTag(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add test for this case
src/ng-select/ng-select.component.ts
Outdated
@@ -422,6 +406,13 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie | |||
} | |||
} | |||
|
|||
focusSearchInput() { | |||
setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is timeout needed?
@@ -0,0 +1,279 @@ | |||
import { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name it ng-dropdown-panel
or just ng-dropdown
since all such files have ng
prefix
private _zone: NgZone, | ||
private _virtualScrollService: VirtualScrollService | ||
) { | ||
this._inputElementRef = _ngSelect.elementRef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it ng-select
elementRef?
@Output() positionChange = new EventEmitter(); | ||
|
||
@ViewChild('content', { read: ElementRef }) contentElementRef: ElementRef; | ||
@ViewChild('scroll', { read: ElementRef }) scrollElementRef: ElementRef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add scrollEnd event and lazy loading example from #267 pr
} | ||
} | ||
|
||
ngOnChanges(changes: SimpleChanges) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method isn't tested
} | ||
|
||
refresh() { | ||
if (IS_TEST) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can anything else can be done here?
import { WindowService } from './window.service'; | ||
|
||
@Component({ | ||
providers: [VirtualScrollService], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here each component instance will have separate instance of VirtualScrollService
, not sure if this is a good idea
const IS_TEST = process.env.NODE_ENV === 'TEST'; | ||
|
||
@Component({ | ||
providers: [VirtualScrollService], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here each component instance will have separate VirtualScrollService
instance, not sure if it is good idea
Looks nice, great job! |
With this PR dropdown panel will be added to the DOM only when dropdown is opened.