Selectr icon indicating copy to clipboard operation
Selectr copied to clipboard

Not seems to work on mobile

Open Aaarrrgggh opened this issue 5 years ago • 2 comments

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

Aaarrrgggh avatar Jun 07 '19 09:06 Aaarrrgggh

It also doesn't work on desktops when nativeDropdown: true is set in options.

kWeb24 avatar Jun 24 '19 12:06 kWeb24

@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.

kWeb24 avatar Jun 24 '19 13:06 kWeb24