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 @@ -46,6 +46,7 @@ import {ResizeStrategy} from './resize-strategy';
4646import { _CoalescedStyleScheduler } from './coalesced-style-scheduler' ;
4747
4848const OVERLAY_ACTIVE_CLASS = 'cdk-resizable-overlay-thumb-active' ;
49+ const RESIZE_DISABLED_CLASS = 'cdk-resizable-resize-disabled' ;
4950
5051/**
5152 * Base class for Resizable directives which are applied to column headers to make those columns
@@ -188,11 +189,18 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
188189 . pipe ( takeUntilDestroyed )
189190 . subscribe ( hoveringRow => {
190191 if ( hoveringRow ) {
191- if ( ! this . overlayRef ) {
192- this . overlayRef = this . _createOverlayForHandle ( ) ;
193- }
192+ const tooBigToResize =
193+ this . maxWidthPxInternal < Number . MAX_SAFE_INTEGER &&
194+ element . offsetWidth > this . maxWidthPxInternal ;
195+ element . classList . toggle ( RESIZE_DISABLED_CLASS , tooBigToResize ) ;
196+
197+ if ( ! tooBigToResize ) {
198+ if ( ! this . overlayRef ) {
199+ this . overlayRef = this . _createOverlayForHandle ( ) ;
200+ }
194201
195- this . _showHandleOverlay ( ) ;
202+ this . _showHandleOverlay ( ) ;
203+ }
196204 } else if ( this . overlayRef ) {
197205 // todo - can't detach during an active resize - need to work that out
198206 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