mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
selected widget should always be on top
This commit is contained in:
parent
7b7480b838
commit
72efb39cfb
1 changed files with 5 additions and 5 deletions
|
|
@ -41,13 +41,14 @@ const resizerStyles = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function getStyles(left, top, isDragging, component) {
|
function getStyles(left, top, isDragging, component, isSelectedComponent) {
|
||||||
const transform = `translate3d(${left}px, ${top}px, 0)`;
|
// const transform = `translate3d(${left}px, ${top}px, 0)`;
|
||||||
return {
|
return {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
height: '100%',
|
||||||
// transform,
|
// transform,
|
||||||
// WebkitTransform: transform,
|
// WebkitTransform: transform,
|
||||||
zIndex: ['DropDown', 'Datepicker', 'DaterangePicker'].includes(component.component) ? 2 : 1,
|
zIndex: isSelectedComponent ? 2 : 1,
|
||||||
// IE fallback: hide the real node using CSS when dragging
|
// IE fallback: hide the real node using CSS when dragging
|
||||||
// because IE will ignore our custom "empty image" drag preview.
|
// because IE will ignore our custom "empty image" drag preview.
|
||||||
opacity: isDragging ? 0 : 1,
|
opacity: isDragging ? 0 : 1,
|
||||||
|
|
@ -176,8 +177,7 @@ export const DraggableBox = function DraggableBox({
|
||||||
<div className={inCanvas ? '' : 'col-md-4 text-center align-items-center clearfix mb-2'}>
|
<div className={inCanvas ? '' : 'col-md-4 text-center align-items-center clearfix mb-2'}>
|
||||||
{inCanvas ? (
|
{inCanvas ? (
|
||||||
<div
|
<div
|
||||||
style={getStyles(left, top, isDragging, component)}
|
style={getStyles(left, top, isDragging, component, isSelectedComponent)}
|
||||||
style={{ height: '100%' }}
|
|
||||||
className="draggable-box "
|
className="draggable-box "
|
||||||
onMouseOver={() => setMouseOver(true)}
|
onMouseOver={() => setMouseOver(true)}
|
||||||
onMouseLeave={() => setMouseOver(false)}
|
onMouseLeave={() => setMouseOver(false)}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue