Fixed issue with table calculations hiding incorectly (#1199)

This commit is contained in:
Harshil Sharma 2021-09-16 12:26:12 +05:30 committed by GitHub
parent 94bdddca8f
commit 81c475028b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,13 +42,12 @@ const CalculationRow = (props: Props): JSX.Element => {
const selectedCalculations = props.board.fields.columnCalculations || [] const selectedCalculations = props.board.fields.columnCalculations || []
const [hovered, setHovered] = useState(false) const [hovered, setHovered] = useState(false)
const toggleHover = () => setHovered(!hovered)
return ( return (
<div <div
className={'CalculationRow octo-table-row'} className={'CalculationRow octo-table-row'}
onMouseEnter={toggleHover} onMouseEnter={() => setHovered(true)}
onMouseLeave={toggleHover} onMouseLeave={() => setHovered(false)}
> >
{ {
templates.map((template) => { templates.map((template) => {
@ -71,7 +70,7 @@ const CalculationRow = (props: Props): JSX.Element => {
const newBoard = createBoard(props.board) const newBoard = createBoard(props.board)
newBoard.fields.columnCalculations = calculations newBoard.fields.columnCalculations = calculations
mutator.updateBlock(newBoard, props.board, 'update_calculation') mutator.updateBlock(newBoard, props.board, 'update_calculation')
toggleHover() setHovered(false)
}} }}
cards={props.cards} cards={props.cards}
property={template} property={template}