Redefine input value width on item edit

This commit is contained in:
Josh Johnson 2016-09-26 13:59:02 +01:00
parent 8ed3fc5277
commit 30fd342b8c
2 changed files with 2 additions and 1 deletions

View file

@ -813,6 +813,7 @@ export default class Choices {
// we can edit the item value. Otherwise if we can remove items, remove all selected items
if (this.config.editItems && !hasHighlightedItems && lastItem) {
this.input.value = lastItem.value;
this.input.style.width = getWidthOfInput(this.input);
this._removeItem(lastItem);
this._triggerChange(lastItem.value);
} else {

View file

@ -470,4 +470,4 @@ export const sortByAlpha = (a, b) => {
export const sortByScore = (a, b) => {
return a.score - b.score;
};
};