Skip to content
Snippets Groups Projects
Commit dfbb883a authored by chris's avatar chris
Browse files

pass z-index

parent 36693165
No related branches found
No related tags found
1 merge request!368Overlay
...@@ -7,7 +7,7 @@ const OverlayContainer = styled.div` ...@@ -7,7 +7,7 @@ const OverlayContainer = styled.div`
left: ${props => `${props.position.left}px`}; left: ${props => `${props.position.left}px`};
position: ${props => props.position.position}; position: ${props => props.position.position};
top: ${props => `${props.position.top}px`}; top: ${props => `${props.position.top}px`};
z-index: 999; z-index: ${props => props.position.zIndex};
`; `;
const Overlay = props => ( const Overlay = props => (
......
...@@ -12,13 +12,11 @@ const defaultOverlay = { ...@@ -12,13 +12,11 @@ const defaultOverlay = {
}; };
export default options => { export default options => {
const { const { activeView } = useContext(WaxContext);
view: { main },
activeView,
} = useContext(WaxContext);
const [position, setPosition] = useState({ const [position, setPosition] = useState({
position: 'absolute', position: 'absolute',
zIndex: 999,
...defaultOverlay, ...defaultOverlay,
}); });
...@@ -107,6 +105,7 @@ export default options => { ...@@ -107,6 +105,7 @@ export default options => {
useLayoutEffect(() => { useLayoutEffect(() => {
setPosition({ setPosition({
position: 'absolute', position: 'absolute',
zIndex: 999,
...updatePosition(options.followCursor), ...updatePosition(options.followCursor),
}); });
}, [JSON.stringify(updatePosition(options.followCursor))]); }, [JSON.stringify(updatePosition(options.followCursor))]);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment