Skip to content

Commit

Permalink
fixes #978 - dropdown.enabled:false has no effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Yair Even Or authored and Yair Even Or committed Feb 5, 2022
1 parent 799c0c0 commit 45b2a8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/parts/dropdown.js
Expand Up @@ -8,12 +8,11 @@ export function initDropdown(){
? this._dropdown[p].bind(this)
: this._dropdown[p]

if( this.settings.dropdown.enabled >= 0 )
this.dropdown.init()
this.dropdown.refs()
}

export default {
init(){
refs(){
this.DOM.dropdown = this.parseTemplate('dropdown', [this.settings])
this.DOM.dropdown.content = this.DOM.dropdown.querySelector(this.settings.classNames.dropdownWrapperSelector)
},
Expand Down Expand Up @@ -181,7 +180,10 @@ export default {
// let the element render in the DOM first, to accurately measure it.
// this.DOM.dropdown.style.cssText = "left:-9999px; top:-9999px;";
var ddHeight = getNodeHeight(this.DOM.dropdown),
_s = this.settings;
_s = this.settings,
enabled = typeof _s.dropdown.enabled == 'number' && _s.dropdown.enabled >= 0;

if( !enabled ) return this;

this.DOM.scope.setAttribute("aria-expanded", true)

Expand Down

0 comments on commit 45b2a8a

Please sign in to comment.