Commit 69818ace authored by Moody Salem's avatar Moody Salem

fix(popover): animation getting stuck open on firefox

parent 42906d67
...@@ -2,36 +2,16 @@ import { Placement } from '@popperjs/core' ...@@ -2,36 +2,16 @@ import { Placement } from '@popperjs/core'
import { transparentize } from 'polished' import { transparentize } from 'polished'
import React, { useState } from 'react' import React, { useState } from 'react'
import { usePopper } from 'react-popper' import { usePopper } from 'react-popper'
import styled, { keyframes } from 'styled-components' import styled from 'styled-components'
import useInterval from '../../hooks/useInterval' import useInterval from '../../hooks/useInterval'
import Portal from '@reach/portal' import Portal from '@reach/portal'
const fadeIn = keyframes`
from {
opacity : 0;
}
to {
opacity : 1;
}
`
const fadeOut = keyframes`
from {
opacity : 1;
}
to {
opacity : 0;
}
`
const PopoverContainer = styled.div<{ show: boolean }>` const PopoverContainer = styled.div<{ show: boolean }>`
z-index: 9999; z-index: 9999;
visibility: ${props => (!props.show ? 'hidden' : 'visible')}; visibility: ${props => (props.show ? 'visible' : 'hidden')};
animation: ${props => (!props.show ? fadeOut : fadeIn)} 150ms linear; opacity: ${props => (props.show ? 1 : 0)};
transition: visibility 150ms linear; transition: visibility 150ms linear, opacity 150ms linear;
background: ${({ theme }) => theme.bg2}; background: ${({ theme }) => theme.bg2};
border: 1px solid ${({ theme }) => theme.bg3}; border: 1px solid ${({ theme }) => theme.bg3};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment