Skip to content

Commit

Permalink
fix(module:select): fix ie11 select search input (#5117)
Browse files Browse the repository at this point in the history
close #5110
  • Loading branch information
Yadong Xie authored Apr 24, 2020
1 parent b83e7b5 commit 83cdc84
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 0 additions & 4 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ $ npm run start

浏览器会自动打开。

## 🗺 Road Map

查看 [这个 issue](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2025) 来了解我们 2019 年的开发计划。

## 🤝 如何贡献

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/NG-ZORRO/ng-zorro-antd/pulls)
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ $ npm run start

Browser would open automatically.

## 🗺 Road Map

Check [this issue](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2025) to read our plans for 2019.

## 🤝 Contributing

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/NG-ZORRO/ng-zorro-antd/pulls)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types';
* https://github.com/angular/angular/issues/34718
*/
@Directive({
selector: '[nz-button],nz-button-group,[nz-icon],[nz-menu-item],[nz-submenu],nz-select-top-control'
selector: '[nz-button],nz-button-group,[nz-icon],[nz-menu-item],[nz-submenu],nz-select-top-control,nz-select-placeholder'
})
export class NzTransitionPatchDirective implements AfterViewInit, OnChanges {
@Input() hidden: NzSafeAny = null;
Expand Down
2 changes: 1 addition & 1 deletion components/select/option-container.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import { NzSelectItemInterface, NzSelectModeType } from './select.types';
}
})
export class NzOptionContainerComponent implements OnChanges {
@Input() notFoundContent: string | undefined = undefined;
@Input() notFoundContent: string | TemplateRef<NzSafeAny> | undefined = undefined;
@Input() menuItemSelectedIcon: TemplateRef<NzSafeAny> | null = null;
@Input() dropdownRender: TemplateRef<NzSafeAny> | null = null;
@Input() activatedValue: NzSafeAny | null = null;
Expand Down
10 changes: 8 additions & 2 deletions components/select/select-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
[attr.autofocus]="autofocus ? 'autofocus' : null"
[disabled]="disabled"
[style.opacity]="showInput ? null : 0"
[readOnly]="!showInput"
(ngModelChange)="onValueChange($event)"
(compositionstart)="setCompositionState(true)"
(compositionend)="setCompositionState(false)"
Expand Down Expand Up @@ -97,10 +96,17 @@ export class NzSelectSearchComponent implements AfterViewInit, OnChanges {

ngOnChanges(changes: SimpleChanges): void {
const inputDOM = this.inputElement.nativeElement;
const { focusTrigger } = changes;
const { focusTrigger, showInput } = changes;
if (focusTrigger && focusTrigger.currentValue === true && focusTrigger.previousValue === false) {
inputDOM.focus();
}
if (showInput) {
if (this.showInput) {
this.renderer.removeAttribute(inputDOM, 'readonly');
} else {
this.renderer.setAttribute(inputDOM, 'readonly', 'readonly');
}
}
}

ngAfterViewInit(): void {
Expand Down
2 changes: 2 additions & 0 deletions components/select/select.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { FormsModule } from '@angular/forms';
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
import { NzOverlayModule } from 'ng-zorro-antd/core/overlay';
import { ɵNzTransitionPatchModule as NzTransitionPatchModule } from 'ng-zorro-antd/core/transition-patch';
import { NzEmptyModule } from 'ng-zorro-antd/empty';
import { NzI18nModule } from 'ng-zorro-antd/i18n';
import { NzIconModule } from 'ng-zorro-antd/icon';
Expand Down Expand Up @@ -43,6 +44,7 @@ import { NzSelectComponent } from './select.component';
NzEmptyModule,
NzOverlayModule,
NzNoAnimationModule,
NzTransitionPatchModule,
ScrollingModule,
A11yModule
],
Expand Down

0 comments on commit 83cdc84

Please sign in to comment.