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] dnd clone design improvements #11

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
prevent jumping in twoLine dragging
  • Loading branch information
andreadelrio committed Sep 22, 2021
commit 8ae7d2961cad98fe4474329f8c2eb08e9f0f4e39
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ $controlMinWidth: $euiSize * 14;
.controlFrame--cloneWrapper {
width: max-content;

.euiFormLabel {
padding-bottom: $euiSizeXS;
}

&-small {
width: $smallControl;
}
Expand All @@ -25,6 +29,10 @@ $controlMinWidth: $euiSize * 14;
width: $largeControl;
}

&-twoLine {
margin-top: -$euiSize * 1.25;
}

.euiFormLabel, div {
cursor: grabbing !important; // prevents cursor flickering while dragging the clone
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,17 @@ export const ControlClone = ({
width: ControlWidth;
}) => {
const embeddable = useChildEmbeddable({ embeddableId, container });

const layout = container.getInput().controlStyle;
return (
<EuiFlexItem
className={classNames('controlFrame--cloneWrapper', {
'controlFrame--cloneWrapper-small': width === 'small',
'controlFrame--cloneWrapper-medium': width === 'medium',
'controlFrame--cloneWrapper-large': width === 'large',
'controlFrame--cloneWrapper-twoLine': layout === 'twoLine',
})}
>
{container.getInput().controlStyle === 'twoLine' ? (
{layout === 'twoLine' ? (
<EuiFormLabel>{embeddable?.getInput().title}</EuiFormLabel>
) : undefined}
<EuiFlexGroup gutterSize="none" className={'controlFrame--draggable'}>
Expand Down