Skip to content
Snippets Groups Projects
Commit 20062df9 authored by jojohoch's avatar jojohoch
Browse files

Prevent placeholder from protruding in height from a dynamic drop list

Use a horizontal aligned placeholder for dynamic aligned drop lists
when there is more than one element in the list
parent ddfa2960
No related branches found
No related tags found
No related merge requests found
......@@ -146,8 +146,8 @@ export class DropListSimpleComponent extends FormElementComponent {
}
setPlaceholderDimensions(itemsCount: number, orientation: unknown): void {
this.placeholderDimensions.height = itemsCount && orientation === 'vertical' ? 1 : 100;
this.placeholderDimensions.width = itemsCount && orientation !== 'vertical' ? 1 : 100;
this.placeholderDimensions.height = itemsCount && orientation !== 'horizontal' ? 1 : 100;
this.placeholderDimensions.width = itemsCount && orientation === 'horizontal' ? 1 : 100;
}
onlyOneItemPredicate = (drag: CdkDrag, drop: CdkDropList): boolean => (
......
......@@ -197,8 +197,8 @@ export class DropListComponent extends FormElementComponent {
}
setPlaceholderDimensions(itemsCount: number, orientation: unknown): void {
this.placeholderDimensions.height = itemsCount && orientation === 'vertical' ? 1 : 100;
this.placeholderDimensions.width = itemsCount && orientation !== 'vertical' ? 1 : 100;
this.placeholderDimensions.height = itemsCount && orientation !== 'horizontal' ? 1 : 100;
this.placeholderDimensions.width = itemsCount && orientation === 'horizontal' ? 1 : 100;
}
onlyOneItemPredicate = (drag: CdkDrag, drop: CdkDropList): boolean => (
......
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