Skip to content

Commit

Permalink
fix(core): Multiselect fix dropdown shaking (#6707)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Feb 7, 2024
1 parent 0118e72 commit 1a148e2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class TuiDropdownPositionDirective extends TuiPositionAccessor {

const hostRect = this.accessor?.getClientRect() ?? EMPTY_CLIENT_RECT;
const viewportRect = this.viewport.getClientRect();
const {minHeight, align, direction, offset} = this.options;
const {minHeight, align, direction, offset, limitWidth} = this.options;
const viewport = {
top: viewportRect.top - offset,
bottom: viewportRect.bottom + offset,
Expand All @@ -49,7 +49,8 @@ export class TuiDropdownPositionDirective extends TuiPositionAccessor {
top: hostRect.top - 2 * offset - viewport.top,
bottom: viewport.bottom - hostRect.bottom - 2 * offset,
} as const;
const right = Math.max(hostRect.right - width, offset);
const rectWidth = limitWidth === 'fixed' ? hostRect.width : width;
const right = Math.max(hostRect.right - rectWidth, offset);
const left = hostRect.left + width < viewport.right ? hostRect.left : right;
const position = {
top: hostRect.top - offset - height,
Expand Down

0 comments on commit 1a148e2

Please sign in to comment.