Skip to content

Commit 261bc4d

Browse files
davdivmanucorporat
authored andcommitted
fix(searchbar): caret moving to the end when typing
1 parent f14d7d6 commit 261bc4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/searchbar/searchbar.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ export class Searchbar extends BaseInput<string> {
188188
*/
189189
_inputUpdated() {
190190
const ele = this._searchbarInput.nativeElement;
191-
if (ele) {
191+
// It is important not to re-assign the value if it is the same, because,
192+
// otherwise, the caret is moved to the end of the input
193+
if (ele && ele.value !== this.value) {
192194
ele.value = this.value;
193195
}
194196
this.positionElements();

0 commit comments

Comments
 (0)