Skip to content

Commit

Permalink
yarn prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
SandraMarcelaHerreraArriaga committed Dec 30, 2019
1 parent 2bc9a9e commit 36756a9
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions packages/material-ui/src/Popover/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,37 +336,38 @@ const Popover = React.forwardRef(function Popover(props, ref) {
}, []);

React.useEffect(() => {
if (open && paperRef.current){
if (open && paperRef.current) {
setPositioningStyles(paperRef.current);
}
});
React.useImperativeHandle(
action,
() =>
open ? {
updatePosition: () => {
setPositioningStyles(paperRef.current);
},
}
: null,
[open, setPositioningStyles],
);
React.useImperativeHandle(
action,
() =>
open
? {
updatePosition: () => {
setPositioningStyles(paperRef.current);
},
}
: null,
[open, setPositioningStyles],
);

React.useEffect(() => {
if (!open) {
return undefined;
}

const handleResize = debounce(() => {
setPositioningStyles(paperRef.current);
});
const handleResize = debounce(() => {
setPositioningStyles(paperRef.current);
});

window.addEventListener('resize',handleResize);
window.addEventListener('resize', handleResize);
return () => {
handleResize.clear();
window.removeEventListener('rezise',handleResize);
window.removeEventListener('rezise', handleResize);
};
}, [open,setPositioningStyles]);
}, [open, setPositioningStyles]);

let transitionDuration = transitionDurationProp;

Expand Down

0 comments on commit 36756a9

Please sign in to comment.