Skip to content

Commit

Permalink
fix(power-bi): 🐛 Quick filter dropdowns now close when clicking outsi…
Browse files Browse the repository at this point in the history
…de the popover (#605)
  • Loading branch information
EdwardBrunton authored Apr 24, 2024
1 parent 6929299 commit 9ae76f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/power-bi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/workspace-powerbi",
"version": "2.0.0",
"version": "2.0.1",
"type": "module",
"sideEffects": false,
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Icon } from '@equinor/eds-core-react';
import { tokens } from '@equinor/eds-tokens';
import { useState, useRef } from 'react';
import { useRef, useState } from 'react';
import styled from 'styled-components';
import { ActiveFilter, PowerBiFilter, PowerBiFilterItem } from '../../types';
import { getFilterHeaderText } from '../../utils/getFilterHeader';
import { FilterController } from '../Filter/Filter';
Expand All @@ -27,6 +28,7 @@ export const PowerBiFilterGroup = ({

return (
<>
{isOpen && <StyledOverlay onClick={() => setIsOpen(false)} />}
<StyledFilterGroupWrapper onClick={() => setIsOpen((s) => !s)} ref={anchorEl}>
<StyledFilterGroupContent>
<div>
Expand Down Expand Up @@ -54,3 +56,13 @@ export const PowerBiFilterGroup = ({
</>
);
};

// Overlay to close the popover when clicking outside it
const StyledOverlay = styled.div`
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999;
`;
2 changes: 1 addition & 1 deletion packages/workspace-fusion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/workspace-fusion",
"version": "8.0.0",
"version": "8.0.1",
"type": "module",
"sideEffects": false,
"license": "MIT",
Expand Down

0 comments on commit 9ae76f9

Please sign in to comment.