Be implicit with loading state calls

This commit is contained in:
Josh Johnson 2016-09-29 14:25:08 +01:00
parent dc94ff9ded
commit 54510a2671

View file

@ -833,7 +833,7 @@ export default class Choices {
if (this.initialised === true) { if (this.initialised === true) {
if (this.passedElement.type === 'select-one' || this.passedElement.type === 'select-multiple') { if (this.passedElement.type === 'select-one' || this.passedElement.type === 'select-multiple') {
// Show loading text // Show loading text
this._handleLoadingState(); this._handleLoadingState(true);
// Run callback // Run callback
fn(this._ajaxCallback()); fn(this._ajaxCallback());
} }
@ -1327,7 +1327,7 @@ export default class Choices {
// If backspace or delete key is pressed and the input has no value // If backspace or delete key is pressed and the input has no value
if (hasFocusedInput && !e.target.value && this.passedElement.type !== 'select-one') { if (hasFocusedInput && !e.target.value && this.passedElement.type !== 'select-one') {
this._handleBackspace(activeItems); this._handleBackspace(activeItems);
this._handleLoadingState(); this._handleLoadingState(false);
e.preventDefault(); e.preventDefault();
} }
}; };