File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
packages/sn-pickers-react/src/components Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -278,7 +278,6 @@ interface PickerAdvancedProps {
278278 onSubmit ?: ( selectedItems : GenericContent [ ] ) => void | undefined
279279 allowMultiple ?: boolean
280280 selectionRoots ?: string [ ]
281- selectionRoots2 ?: string [ ]
282281 showDialogTitle ?: boolean
283282 canPick ?: boolean
284283 showSearch ?: boolean
@@ -295,7 +294,7 @@ export const PickerAdvanced: React.FC<PickerAdvancedProps> = ({
295294 onCancel,
296295 onSubmit,
297296 allowMultiple = true ,
298- selectionRoots = [ '/Root' ] ,
297+ selectionRoots,
299298 showDialogTitle = true ,
300299 canPick = true ,
301300 showSearch = true ,
@@ -554,9 +553,10 @@ export const PickerAdvanced: React.FC<PickerAdvancedProps> = ({
554553 </ div >
555554 < div className = { classes . buttonsCont } >
556555 < div className = { classes . errorMsg } >
557- { ! selectionRoots . some ( ( root ) => currentPath === root || currentPath . startsWith ( `${ root } /` ) ) && (
558- < div > Disabled Path</ div >
559- ) }
556+ { selectionRoots &&
557+ ! selectionRoots . some ( ( root ) => currentPath === root || currentPath . startsWith ( `${ root } /` ) ) && (
558+ < div > Disabled Path</ div >
559+ ) }
560560 </ div >
561561 < Button
562562 type = "button"
@@ -568,7 +568,8 @@ export const PickerAdvanced: React.FC<PickerAdvancedProps> = ({
568568 < Button
569569 type = "button"
570570 disabled = {
571- ! selectionRoots . some ( ( root ) => currentPath === root || currentPath . startsWith ( `${ root } /` ) ) ||
571+ ( selectionRoots &&
572+ ! selectionRoots . some ( ( root ) => currentPath === root || currentPath . startsWith ( `${ root } /` ) ) ) ||
572573 ( isRequired && ! selectedItems . length )
573574 }
574575 onClick = { ( ) => {
You can’t perform that action at this time.
0 commit comments