Skip to content
Snippets Groups Projects
Commit f5243b4a authored by Leonardo Christino's avatar Leonardo Christino
Browse files

fix(ml_panel): fix ml panel positioning

the panel was badly positioned to the right while the button is to the left
parent b977f3ec
No related branches found
No related tags found
1 merge request!39fix(ml_panel): fix ml panel positioning
import { useState } from 'react';
export const Popup = (props: { children: React.ReactNode; open: boolean; vanchor: 'left' | 'right' }) => {
export const Popup = (props: { children: React.ReactNode; open: boolean; hAnchor: 'left' | 'right' }) => {
return (
<>
{props.open && (
<div className={`absolute ${props.vanchor}-20 z-10 max-w-[20rem] bg-offwhite-100 flex flex-col gap-2 animate-openmenu`}>
<div
className="absolute z-10 max-w-[20rem] bg-offwhite-100 flex flex-col gap-2 animate-openmenu"
style={props.hAnchor === 'left' ? { left: '5rem' } : { right: '5rem' }}
>
{props.children}
</div>
)}
......
......@@ -450,7 +450,7 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => {
onDrag={() => {}}
/>
</Dialog>
<Popup open={openMLDialog} vanchor="right">
<Popup open={openMLDialog} hAnchor="right">
<QueryBuilderMLPanel />
</Popup>
<ReactFlow
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment