fix(all): avoid using focus() since it conflicts with HTMLElement

fixes #15810
This commit is contained in:
Manu Mtz.-Almeida
2018-10-02 16:53:58 +02:00
parent 6a5aec8b5d
commit 5560dcd713
10 changed files with 28 additions and 23 deletions

View File

@ -245,7 +245,7 @@ export class Input implements ComponentInterface {
}
@Method()
focus() {
setFocus() {
if (this.nativeInput) {
this.nativeInput.focus();
}

View File

@ -57,9 +57,9 @@ It is meant for text `type` inputs only, such as `"text"`, `"password"`, `"email
## Methods
| Method | Description |
| ------- | ----------- |
| `focus` | |
| Method | Description |
| ---------- | ----------- |
| `setFocus` | |
----------------------------------------------

View File

@ -44,9 +44,9 @@ A Searchbar should be used instead of an input to search lists. A clear button i
## Methods
| Method | Description |
| ------- | ----------- |
| `focus` | |
| Method | Description |
| ---------- | ----------- |
| `setFocus` | |
## CSS Custom Properties

View File

@ -141,7 +141,7 @@ export class Searchbar implements ComponentInterface {
protected valueChanged() {
const inputEl = this.nativeInput;
const value = this.value;
if (inputEl.value !== value) {
if (inputEl && inputEl.value !== value) {
inputEl.value = value;
}
this.ionChange.emit({ value });
@ -153,8 +153,10 @@ export class Searchbar implements ComponentInterface {
}
@Method()
focus() {
this.nativeInput.focus();
setFocus() {
if (this.nativeInput) {
this.nativeInput.focus();
}
}
/**

View File

@ -48,9 +48,9 @@ The textarea component accepts the [native textarea attributes](https://develope
## Methods
| Method | Description |
| ------- | ----------- |
| `focus` | |
| Method | Description |
| ---------- | ----------- |
| `setFocus` | |
## CSS Custom Properties

View File

@ -169,7 +169,7 @@ export class Textarea implements ComponentInterface {
}
@Method()
focus() {
setFocus() {
if (this.nativeInput) {
this.nativeInput.focus();
}