@@ -495,11 +495,12 @@ interface KanbanColumnProps extends SlotProps {
495
495
value : UniqueIdentifier ;
496
496
children : React . ReactNode ;
497
497
asChild ?: boolean ;
498
+ disabled ?: boolean ;
498
499
}
499
500
500
501
const KanbanColumn = React . forwardRef < HTMLDivElement , KanbanColumnProps > (
501
502
( props , forwardedRef ) => {
502
- const { value, asChild, className, ...columnProps } = props ;
503
+ const { value, asChild, disabled , className, ...columnProps } = props ;
503
504
504
505
const context = useKanbanContext ( "column" ) ;
505
506
const inBoard = React . useContext ( KanbanBoardContext ) ;
@@ -513,6 +514,7 @@ const KanbanColumn = React.forwardRef<HTMLDivElement, KanbanColumnProps>(
513
514
514
515
const { setNodeRef } = useDroppable ( {
515
516
id : value ,
517
+ disabled,
516
518
} ) ;
517
519
518
520
const ColumnSlot = asChild ? Slot : "div" ;
@@ -522,20 +524,19 @@ const KanbanColumn = React.forwardRef<HTMLDivElement, KanbanColumnProps>(
522
524
return items . map ( ( item ) => context . getItemValue ( item ) ) ;
523
525
} , [ context . items , value , context . getItemValue ] ) ;
524
526
525
- const composedRef = useComposedRefs (
526
- forwardedRef ,
527
- ( node : HTMLDivElement | null ) => {
528
- if ( node ) setNodeRef ( node ) ;
529
- } ,
530
- ) ;
527
+ const composedRef = useComposedRefs ( forwardedRef , ( node ) => {
528
+ if ( disabled ) return ;
529
+ setNodeRef ( node ) ;
530
+ } ) ;
531
531
532
532
return (
533
533
< SortableContext strategy = { context . strategy } items = { items } >
534
534
< ColumnSlot
535
+ aria-disabled = { disabled }
535
536
{ ...columnProps }
536
537
ref = { composedRef }
537
538
className = { cn (
538
- "flex size-full flex-col gap-2 rounded-lg border bg-zinc-100 p-4 dark:bg-zinc-900" ,
539
+ "flex size-full flex-col gap-2 rounded-lg border bg-zinc-100 p-4 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:bg-zinc-900" ,
539
540
className ,
540
541
) }
541
542
/>
0 commit comments