Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Not seems to work on mobile #124

Open
Aaarrrgggh opened this issue Jun 7, 2019 · 2 comments
Open

Not seems to work on mobile #124

Aaarrrgggh opened this issue Jun 7, 2019 · 2 comments

Comments

@Aaarrrgggh
Copy link

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

@kWeb24
Copy link

kWeb24 commented Jun 24, 2019

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

@kWeb24
Copy link

kWeb24 commented Jun 24, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants