Skip to content

Commit

Permalink
fix(popover): animation getting stuck open on firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Jun 28, 2020
1 parent 42906d6 commit 69818ac
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/components/Popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,16 @@ import { Placement } from '@popperjs/core'
import { transparentize } from 'polished'
import React, { useState } from 'react'
import { usePopper } from 'react-popper'
import styled, { keyframes } from 'styled-components'
import styled from 'styled-components'
import useInterval from '../../hooks/useInterval'
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 }>`
z-index: 9999;
visibility: ${props => (!props.show ? 'hidden' : 'visible')};
animation: ${props => (!props.show ? fadeOut : fadeIn)} 150ms linear;
transition: visibility 150ms linear;
visibility: ${props => (props.show ? 'visible' : 'hidden')};
opacity: ${props => (props.show ? 1 : 0)};
transition: visibility 150ms linear, opacity 150ms linear;
background: ${({ theme }) => theme.bg2};
border: 1px solid ${({ theme }) => theme.bg3};
Expand Down

1 comment on commit 69818ac

@vercel
Copy link

@vercel vercel bot commented on 69818ac Jun 28, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.