Skip to content

Commit

Permalink
fix(searchbar): caret moving to the end when typing
Browse files Browse the repository at this point in the history
  • Loading branch information
davdiv authored and manucorporat committed May 27, 2017
1 parent f14d7d6 commit 261bc4d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/searchbar/searchbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ export class Searchbar extends BaseInput<string> {
*/
_inputUpdated() {
const ele = this._searchbarInput.nativeElement;
if (ele) {
// It is important not to re-assign the value if it is the same, because,
// otherwise, the caret is moved to the end of the input
if (ele && ele.value !== this.value) {
ele.value = this.value;
}
this.positionElements();
Expand Down

2 comments on commit 261bc4d

@vista-54
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amm. Ionic 4 has same problem in iOs platform. How I can fix it?

@vista-54
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.