Housekeeping

This commit is contained in:
Josh Johnson 2016-08-18 17:56:27 +01:00
parent 5e10f0eda8
commit 9b6cc40f58
2 changed files with 3 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -367,7 +367,7 @@ export default class Choices {
* @return {Object} Class instance
* @public
*/
showDropdown(focusInput) {
showDropdown(focusInput = false) {
const body = document.body;
const html = document.documentElement;
const winHeight = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
@ -387,6 +387,7 @@ export default class Choices {
this.containerOuter.classList.remove(this.config.classNames.flippedState);
}
// Optionally focus the input if we have a search input
if (focusInput && this.canSearch && document.activeElement !== this.input) {
this.input.focus();
}