Skip to content

Commit

Permalink
Disable animations on IE
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jul 3, 2019
1 parent 90de4d5 commit 3279e11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/compose/src/hooks/use-reduced-motion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
*/
import useMediaQuery from '../use-media-query';

/**
* Whether or not the user agent is Internet Explorer.
*
* @type {boolean}
*/
const IS_IE = window.navigator.userAgent.indexOf( 'Trident' ) >= 0;

/**
* Hook returning whether the user has a preference for reduced motion.
*
* @return {boolean} Reduced motion preference value.
*/
const useReducedMotion =
process.env.FORCE_REDUCED_MOTION ?
process.env.FORCE_REDUCED_MOTION || IS_IE ?
() => true :
() => useMediaQuery( '(prefers-reduced-motion: reduce)' );

Expand Down

0 comments on commit 3279e11

Please sign in to comment.