Skip to content

Commit 69818ac

Browse files
committed
fix(popover): animation getting stuck open on firefox
1 parent 42906d6 commit 69818ac

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

src/components/Popover/index.tsx

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,16 @@ import { Placement } from '@popperjs/core'
22
import { transparentize } from 'polished'
33
import React, { useState } from 'react'
44
import { usePopper } from 'react-popper'
5-
import styled, { keyframes } from 'styled-components'
5+
import styled from 'styled-components'
66
import useInterval from '../../hooks/useInterval'
77
import Portal from '@reach/portal'
88

9-
const fadeIn = keyframes`
10-
from {
11-
opacity : 0;
12-
}
13-
14-
to {
15-
opacity : 1;
16-
}
17-
`
18-
19-
const fadeOut = keyframes`
20-
from {
21-
opacity : 1;
22-
}
23-
24-
to {
25-
opacity : 0;
26-
}
27-
`
28-
299
const PopoverContainer = styled.div<{ show: boolean }>`
3010
z-index: 9999;
3111
32-
visibility: ${props => (!props.show ? 'hidden' : 'visible')};
33-
animation: ${props => (!props.show ? fadeOut : fadeIn)} 150ms linear;
34-
transition: visibility 150ms linear;
12+
visibility: ${props => (props.show ? 'visible' : 'hidden')};
13+
opacity: ${props => (props.show ? 1 : 0)};
14+
transition: visibility 150ms linear, opacity 150ms linear;
3515
3616
background: ${({ theme }) => theme.bg2};
3717
border: 1px solid ${({ theme }) => theme.bg3};

0 commit comments

Comments
 (0)