File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
cdk-experimental/column-resize
material-experimental/column-resize Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ import {ResizeRef} from './resize-ref';
4040import { ResizeStrategy } from './resize-strategy' ;
4141
4242const OVERLAY_ACTIVE_CLASS = 'cdk-resizable-overlay-thumb-active' ;
43+ const RESIZE_DISABLED_CLASS = 'cdk-resizable-resize-disabled' ;
4344
4445/**
4546 * Base class for Resizable directives which are applied to column headers to make those columns
@@ -181,11 +182,18 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
181182 . pipe ( takeUntilDestroyed )
182183 . subscribe ( hoveringRow => {
183184 if ( hoveringRow ) {
184- if ( ! this . overlayRef ) {
185- this . overlayRef = this . _createOverlayForHandle ( ) ;
186- }
185+ const tooBigToResize =
186+ this . maxWidthPxInternal < Number . MAX_SAFE_INTEGER &&
187+ element . offsetWidth > this . maxWidthPxInternal ;
188+ element . classList . toggle ( RESIZE_DISABLED_CLASS , tooBigToResize ) ;
189+
190+ if ( ! tooBigToResize ) {
191+ if ( ! this . overlayRef ) {
192+ this . overlayRef = this . _createOverlayForHandle ( ) ;
193+ }
187194
188- this . _showHandleOverlay ( ) ;
195+ this . _showHandleOverlay ( ) ;
196+ }
189197 } else if ( this . overlayRef ) {
190198 // todo - can't detach during an active resize - need to work that out
191199 this . overlayRef . detach ( ) ;
Original file line number Diff line number Diff line change 7171 .mat-resizable-handle {
7272 background : $resizable-hover-divider ;
7373 }
74+
75+ .cdk-resizable-resize-disabled > .mat-resizable-handle {
76+ background : $non-resizable-hover-divider ;
77+ }
7478 }
7579
7680 [dir = ' rtl' ] {
You can’t perform that action at this time.
0 commit comments