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(useMediaQuery): add support for safari 13- #249

Merged
merged 1 commit into from Aug 6, 2021
Merged

fix(useMediaQuery): add support for safari 13- #249

merged 1 commit into from Aug 6, 2021

Conversation

xobotyi
Copy link
Contributor

@xobotyi xobotyi commented Aug 5, 2021

What is the current behavior, and the steps to reproduce the issue?

As Safari 13- has obsolete MediaQueryList API - it requires some extra checks.

What is the expected behavior?

Shpould Work on safari 13-

How does this PR fix the problem?

Check addEventListener and removeEventListener methods existence and fallback to addListener and removeListener respectively.

Checklist

  • Have you read contribution guideline?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Is there an existing issue for this PR?
  • Have the files been linted and formatted?
  • Have the docs been updated to match the changes in the PR?
  • Have the tests been updated to match the changes in the PR?
  • Have you run the tests locally to confirm they pass?

@xobotyi xobotyi requested a review from JoeDuncko August 5, 2021 09:33
@codecov
Copy link

codecov bot commented Aug 5, 2021

Codecov Report

Merging #249 (be9a2bb) into master (2da8c5f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #249   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           43        43           
  Lines          749       751    +2     
  Branches       133       135    +2     
=========================================
+ Hits           749       751    +2     
Impacted Files Coverage Δ
src/useMediaQuery/useMediaQuery.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2da8c5f...be9a2bb. Read the comment docs.

@xobotyi xobotyi merged commit 25c8599 into master Aug 6, 2021
@xobotyi xobotyi deleted the fix-242 branch August 6, 2021 12:42
github-actions bot pushed a commit that referenced this pull request Aug 6, 2021
# [7.0.0](v6.1.0...v7.0.0) (2021-08-06)

### Bug Fixes

* **useMediaQuery:** add support for safari 13- that has obsolete `useMediaQuery` implementation ([#249](#249)) ([25c8599](25c8599)), closes [#242](#242)

### Code Refactoring

* **useKeyboardEvent:** improve the code and change signature ([#248](#248)) ([a0e1b24](a0e1b24))

### BREAKING CHANGES

* **useKeyboardEvent:** hook call signature has changed.
@xobotyi
Copy link
Contributor Author

xobotyi commented Aug 6, 2021

🎉 This PR is included in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

useMediaQuery Safari support
1 participant