Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't select choices on Safari mobile (iOS 12) #549

Closed
psmyrdek opened this issue Mar 15, 2019 · 2 comments
Closed

Can't select choices on Safari mobile (iOS 12) #549

psmyrdek opened this issue Mar 15, 2019 · 2 comments

Comments

@psmyrdek
Copy link

psmyrdek commented Mar 15, 2019

Hi everyone,

I'm facing a problem that seems to be somehow connected to Safari mobile, yet it cannot be reproduced on Choices demo page.

I'm using Choices to build my multiselect, but on Safari mobile (iOS 12) choices from the list cannot be selected by pressing them. The only way to select an item is to press enter on the keyboard.

My setup is pretty simple (it's a component written using Stencil.js):

import Choices from 'choices.js/public/assets/scripts/choices.js'

class MyComponent {

  ...
  
  choicesMultiselect: Choices;

  componentDidLoad() {

        const availableChoices = [...]

        this.choicesMultiselect = new Choices(document.querySelector(`#${this.containerId}`), {
            removeItemButton: true,
            itemSelectText: '',
            choices: availableChoices,
            noResultsText: this.i18nLabels.form_controls.multiselect.no_results,
            noChoicesText: this.i18nLabels.form_controls.multiselect.no_choices
        });
    }

  render() {
        return (
            <div class="question-control">
                <select id={this.containerId} multiple class="display--none" onChange={this.handleChange}></select>
            </div>
        )
    }
}

Everything works fine on most of the browsers except Safari on iOS - even Android works fine. Even Safari on Mac works fine. I guess it might be events that are being fired on this specific browser which may be incorrect. Do you have any ideas on how to solve that? (I was testing Choices demo page on the same browser and your examples work fine)

I was also trying to attach an event listener to the original select element via

this.choicesMultiselect.passedElement.element.addEventListener('change', this.handleChange)

but it's the same result as through Stencil's `onChange'.

Reproducing it via BrowserStack - https://streamable.com/ifuiv

@stale stale bot added the stale label Jun 23, 2019
@stale stale bot closed this as completed Jul 3, 2019
@Choices-js Choices-js deleted a comment from stale bot Jul 3, 2019
@jshjohnson jshjohnson reopened this Jul 3, 2019
@stale stale bot removed the stale label Jul 3, 2019
@mtriff
Copy link
Member

mtriff commented Dec 19, 2021

Please create a new issue if this is still an issue on current iOS versions.

@mtriff mtriff closed this as completed Dec 19, 2021
@owen2345
Copy link

Same issue here

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

No branches or pull requests

4 participants