Selectr
Selectr copied to clipboard
Not seems to work on mobile
Hi all,
Thanks for this great plugin.
Works fine on desktop, but cannot do it working on mobile devices.
Here is my code:
selector = new Selectr('#tags', {
searchable: false,
width: 300,
multiple: false,
taggable: true,
tagPlaceholder: tag_label,
defaultSelected: true,
renderSelection: myRenderFunction,
selectedValue: datas,
mobileDevice: true
});
the ul with selectr-options class stays empty.
Thanks!
Alexander
It also doesn't work on desktops when nativeDropdown: true
is set in options.
@Aaarrrgggh hotfix for v2.4.8:
In selectr.js file, build()
method line 385
replace:
this.el.setAttribute("aria-hidden", true);
with
if (this.mobileDevice || this.nativeDropdown) {
this.el.setAttribute('aria-hidden', false);
} else {
this.el.setAttribute('aria-hidden', true);
}
Now it'll work for both mobile devices and nativeDropdown flag. Doesn't work on window resize event but i don't need it so won't bother with that.