Skip to content

Commit 6b956c3

Browse files
authored
Demos: Autocomplete, multiple: scroll input to the right on addition
Exposes the last added item in narrow <input> containers.
1 parent 74f8a0a commit 6b956c3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

demos/autocomplete/multiple.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
// add placeholder to get the comma-and-space at the end
6868
terms.push( "" );
6969
this.value = terms.join( ", " );
70+
// scroll input viewport to as far right as possible
71+
this.selectionStart = this.selectionEnd = this.value.length;
7072
return false;
7173
}
7274
});

0 commit comments

Comments
 (0)