File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
forms-flow-components/src/components/CustomComponents Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,11 @@ export const SortModal: React.FC<SortModalProps> = React.memo(
6464 }
6565 } , [ showSortModal , defaultSortOption , defaultSortOrder ] ) ;
6666
67+ const isPrimaryButtonDisabled =
68+ ! selectedOption ||
69+ ! selectedOrder ||
70+ ( selectedOption === defaultSortOption &&
71+ selectedOrder === defaultSortOrder ) ;
6772 return (
6873 < Modal show = { showSortModal } onHide = { onClose } size = "sm" centered = { true } >
6974 < Modal . Header >
@@ -119,9 +124,7 @@ export const SortModal: React.FC<SortModalProps> = React.memo(
119124 < CustomButton
120125 variant = "primary"
121126 size = "md"
122- disabled = { ! selectedOption ||
123- ! selectedOrder ||
124- ( selectedOption === defaultSortOption && selectedOrder === defaultSortOrder ) }
127+ disabled = { isPrimaryButtonDisabled }
125128 label = { t ( primaryBtnLabel ) }
126129 onClick = { handlePrimaryAction }
127130 name = "applyButton"
You can’t perform that action at this time.
0 commit comments