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

fix(js): provide fallback method for addEventListener on media queries #600

Merged
merged 6 commits into from
Jun 11, 2021

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Jun 1, 2021

Summary

addEventListener on media queries isn't supported for iOS <= 13.6, which causes Autocomplete to crash the application. We now provide a fallback solution to the deprecated method addListener.

Result

Autocomplete no longer crashes on iOS <= 13.6

Video

Following the steps of #597, the device is an iPhone 11 running on iOS 13.6.

  • At the beginning, we can see the sandbox of the issue (without the workaround) throwing an error. sandbox
  • The second sandbox is the one from this commit, with the code from app.tsx (from the one above) copy pasted. sandbox
Screen.Recording.2021-06-09.at.17.41.23.mov

Closes #597

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 1, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 369e91a:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-voice-search Configuration
@algolia/autocomplete-example-vue Configuration
silly-butterfly-5mdp6 PR
@algolia/autocomplete-example-starter-algolia (forked) PR

@shortcuts shortcuts marked this pull request as ready for review June 10, 2021 07:30
shortcuts and others added 4 commits June 10, 2021 13:52
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
@shortcuts shortcuts force-pushed the fix/mediaQuery-eventListener branch from ac0e92c to 369e91a Compare June 10, 2021 15:01
Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool refactor 🙂

@shortcuts shortcuts merged commit 760f8e7 into next Jun 11, 2021
@shortcuts shortcuts deleted the fix/mediaQuery-eventListener branch June 11, 2021 07:24
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

Successfully merging this pull request may close these issues.

Detached mode fails to initialize on iOS 13.6 and below
2 participants