Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Controls] Prevent jumping control drag handle between view modes #184533

Merged
merged 9 commits into from
Jun 13, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const SortableControlInner = forwardRef<
const width = panels[embeddableId].width;
const title = panels[embeddableId].explicitInput.title;

const dragHandle = (
const dragHandle = isEditable ? (
<button
ref={dragHandleRef}
{...dragHandleProps}
Expand All @@ -84,6 +84,8 @@ const SortableControlInner = forwardRef<
>
<EuiIcon type="grabHorizontal" />
</button>
) : (
<EuiIcon type="empty" size="s" />
);

return (
Expand All @@ -108,7 +110,7 @@ const SortableControlInner = forwardRef<
enableActions={draggingIndex === -1}
embeddableId={embeddableId}
embeddableType={embeddableType}
customPrepend={isEditable ? dragHandle : undefined}
customPrepend={dragHandle}
/>
</EuiFlexItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ $controlMinWidth: $euiSize * 14;
max-width: 40%;
}

&-isEditable {
.controlFrame__formControlLayoutLabel {
padding-left: 0;
}
.controlFrame__formControlLayoutLabel {
padding-left: 0;
}

.controlFrame__formControlLayout {
Expand Down