mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Feature: Elements should be draggable within container
This commit is contained in:
parent
1db2fb7083
commit
743190d46c
2 changed files with 25 additions and 4 deletions
|
|
@ -1,8 +1,15 @@
|
|||
import React from 'react';
|
||||
import React, { useRef } from 'react';
|
||||
import { SubCustomDragLayer } from '../SubCustomDragLayer';
|
||||
import { SubContainer } from '../SubContainer';
|
||||
|
||||
export const Container = function Container({
|
||||
id, width, height, component, onComponentClick
|
||||
id,
|
||||
component,
|
||||
height,
|
||||
containerProps,
|
||||
width
|
||||
}) {
|
||||
|
||||
const backgroundColor = component.definition.styles.backgroundColor.value;
|
||||
|
||||
const computedStyles = {
|
||||
|
|
@ -11,5 +18,19 @@ export const Container = function Container({
|
|||
height
|
||||
};
|
||||
|
||||
return <div className="jet-container" onClick={() => onComponentClick(id, component)} style={computedStyles}></div>;
|
||||
const parentRef = useRef(null);
|
||||
|
||||
return (
|
||||
<div className="jet-container" ref={parentRef} onClick={() => containerProps.onComponentClick(id, component)} style={computedStyles}>
|
||||
<SubContainer
|
||||
parent={id}
|
||||
{...containerProps}
|
||||
parentRef={parentRef}
|
||||
/>
|
||||
<SubCustomDragLayer
|
||||
snapToGrid={true}
|
||||
parentRef={parentRef}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export const EventSelector = ({
|
|||
value={definition.options.model}
|
||||
search={true}
|
||||
onChange={(value) => {
|
||||
eventOptionUpdated(param, 'model', value, extraData);
|
||||
eventOptionUpdated(param, 'modal', value, extraData);
|
||||
}}
|
||||
filterOptions={fuzzySearch}
|
||||
placeholder="Select.."
|
||||
|
|
|
|||
Loading…
Reference in a new issue