slim-select
Advanced tools
Comparing version 1.4.1 to 1.4.2
{ | ||
"name": "slim-select", | ||
"description": "Slim vanilla javascript select dropdown", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"author": "Brian Voelker <brian@webiswhatido.com> (http://webiswhatido.com)", | ||
@@ -35,4 +35,4 @@ "homepage": "https://slimselectjs.com", | ||
"highlightjs": "^9.10.0", | ||
"vue-build": "^2.1.1" | ||
"vue-build": "^2.1.2" | ||
} | ||
} |
@@ -290,5 +290,7 @@ import SlimSelect from './index' | ||
if (e.key === 'ArrowUp') { | ||
this.main.open() | ||
this.highlightUp() | ||
e.preventDefault() | ||
} else if (e.key === 'ArrowDown') { | ||
this.main.open() | ||
this.highlightDown() | ||
@@ -330,3 +332,11 @@ e.preventDefault() | ||
if (highlighted) { | ||
prev = highlighted.previousSibling | ||
prev = <HTMLDivElement>highlighted.previousSibling | ||
while (prev !== null) { | ||
if (prev.classList.contains(this.main.config.disabled)) { | ||
prev = <HTMLDivElement>prev.previousSibling | ||
continue | ||
} else { | ||
break | ||
} | ||
} | ||
} else { | ||
@@ -345,3 +355,6 @@ var allOptions = this.list.querySelectorAll('.' + this.main.config.option + ':not(.'+this.main.config.disabled+')') | ||
if (parent.previousSibling) { | ||
prev = parent.previousSibling.childNodes[parent.previousSibling.childNodes.length - 1] | ||
let prevNodes = (<HTMLDivElement>parent.previousSibling).querySelectorAll('.' + this.main.config.option + ':not(.'+this.main.config.disabled+')') | ||
if (prevNodes.length) { | ||
prev = prevNodes[prevNodes.length - 1] | ||
} | ||
} | ||
@@ -361,10 +374,20 @@ } | ||
var highlighted = <HTMLDivElement>this.list.querySelector('.' + this.main.config.highlighted) | ||
var next = ( | ||
highlighted ? | ||
<HTMLDivElement>highlighted.nextSibling : | ||
<HTMLDivElement>this.list.querySelector('.' + this.main.config.option + ':not(.'+this.main.config.disabled+')') | ||
) | ||
var next = null | ||
if (highlighted) { | ||
next = <HTMLDivElement>highlighted.nextSibling | ||
while (next !== null) { | ||
if (next.classList.contains(this.main.config.disabled)) { | ||
next = <HTMLDivElement>next.nextSibling | ||
continue | ||
} else { | ||
break | ||
} | ||
} | ||
} else { | ||
next = <HTMLDivElement>this.list.querySelector('.' + this.main.config.option + ':not(.'+this.main.config.disabled+')') | ||
} | ||
// Check if parent is optgroup | ||
if (next === null) { | ||
if (next === null && highlighted !== null) { | ||
var parent = <HTMLDivElement>highlighted.parentNode | ||
@@ -371,0 +394,0 @@ if (parent.classList.contains(this.main.config.optgroup)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1072705
1483