Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 12 additions & 4 deletions src/cdk-experimental/column-resize/resizable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {ResizeStrategy} from './resize-strategy';
import {_CoalescedStyleScheduler} from './coalesced-style-scheduler';

const OVERLAY_ACTIVE_CLASS = 'cdk-resizable-overlay-thumb-active';
const RESIZE_DISABLED_CLASS = 'cdk-resizable-resize-disabled';

/**
* Base class for Resizable directives which are applied to column headers to make those columns
Expand Down Expand Up @@ -188,11 +189,18 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
.pipe(takeUntilDestroyed)
.subscribe(hoveringRow => {
if (hoveringRow) {
if (!this.overlayRef) {
this.overlayRef = this._createOverlayForHandle();
}
const tooBigToResize =
this.maxWidthPxInternal < Number.MAX_SAFE_INTEGER &&
element.offsetWidth > this.maxWidthPxInternal;
element.classList.toggle(RESIZE_DISABLED_CLASS, tooBigToResize);

if (!tooBigToResize) {
if (!this.overlayRef) {
this.overlayRef = this._createOverlayForHandle();
}

this._showHandleOverlay();
this._showHandleOverlay();
}
} else if (this.overlayRef) {
// todo - can't detach during an active resize - need to work that out
this.overlayRef.detach();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
.mat-resizable-handle {
background: $resizable-hover-divider;
}

.cdk-resizable-resize-disabled > .mat-resizable-handle {
background: $non-resizable-hover-divider;
}
}

[dir='rtl'] {
Expand Down
Loading