From ba31244617dcb05440701600939bba837575cd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9COscar?= Date: Tue, 10 Oct 2023 12:43:05 -0600 Subject: [PATCH 1/3] react selectNext updating isdisabled prop --- src/inputs/selectNext/selectNext.tsx | 30 ++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/inputs/selectNext/selectNext.tsx b/src/inputs/selectNext/selectNext.tsx index 65b3116c..9570129b 100644 --- a/src/inputs/selectNext/selectNext.tsx +++ b/src/inputs/selectNext/selectNext.tsx @@ -31,6 +31,10 @@ type PropTypes = { */ className?: string; /** + * A Select can be disabled + */ + isDisabled?: boolean, + /** * Supply dropdown menu maximum height */ dropdownMenuMaxHeight?: number; @@ -99,6 +103,7 @@ type PropTypes = { const defaultProps = { alwaysShowRequiredIndicator: false, className: null, + isDisabled: false, dropdownMenuMaxHeight: 180, dropdownMenuMinHeight: null, id: null, @@ -125,6 +130,7 @@ const useStyles = makeStyles((theme) => { // Control Options const selectInputBg = p.background.primary; + const selectInputBgDisabled = p.background.secondary; const selectInputBgFocus = p.background.contrastPrimary; const selectInputBorderColor = p.border.primary; const selectInputBorderRadius = '3px'; @@ -194,6 +200,12 @@ const useStyles = makeStyles((theme) => { fill: `${selectInputArrowColorFocus} !important`, }, }, + '&--is-disabled': { + backgroundColor: selectInputBgDisabled, + '&:hover': { + boxShadow: 'none', + }, + }, '&--is-focused:not(.react_select__control--menu-is-open)': { borderColor: `${selectInputBorderFocus} ${selectInputBorderFocus} ${selectInputBorderFocus}`, boxShadow: [ @@ -299,12 +311,14 @@ const CustomArrow = (componentProps) => ( {...componentProps} >
- + {// @ts-ignore + + }
); @@ -343,6 +357,7 @@ const CustomOption = (componentProps) => { const { children, className, + isDisabled, innerRef, isSelected, selectOption, @@ -358,6 +373,7 @@ const CustomOption = (componentProps) => { {...componentProps} aria-selected={isSelected} className={optionClass} + isDisabled={isDisabled} selectOption={selectOption} ref={innerRef} tabIndex={0} @@ -383,6 +399,7 @@ const SelectNext = React.forwardRef(function SelectNext( const { alwaysShowRequiredIndicator, className, + isDisabled, dropdownMenuMaxHeight, dropdownMenuMinHeight, id, @@ -450,6 +467,7 @@ const SelectNext = React.forwardRef(function SelectNext( // @ts-ignore dropdownMenuMaxHeight={dropdownMenuMaxHeight} dropdownMenuMinHeight={dropdownMenuMinHeight} + isDisabled={isDisabled} isSearchable={isSearchable} menuPortalTarget={menuPortalTarget} name={name} From 4e8f4836896deffef8c3d0c5e2ca16efbc5bef89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9COscar?= Date: Tue, 10 Oct 2023 13:14:31 -0600 Subject: [PATCH 2/3] select updates --- src/inputs/selectNext/selectNext.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/inputs/selectNext/selectNext.tsx b/src/inputs/selectNext/selectNext.tsx index 9570129b..484572ac 100644 --- a/src/inputs/selectNext/selectNext.tsx +++ b/src/inputs/selectNext/selectNext.tsx @@ -33,7 +33,7 @@ type PropTypes = { /** * A Select can be disabled */ - isDisabled?: boolean, + disabled?: boolean, /** * Supply dropdown menu maximum height */ @@ -103,7 +103,7 @@ type PropTypes = { const defaultProps = { alwaysShowRequiredIndicator: false, className: null, - isDisabled: false, + disabled: false, dropdownMenuMaxHeight: 180, dropdownMenuMinHeight: null, id: null, @@ -357,7 +357,7 @@ const CustomOption = (componentProps) => { const { children, className, - isDisabled, + disabled, innerRef, isSelected, selectOption, @@ -373,7 +373,7 @@ const CustomOption = (componentProps) => { {...componentProps} aria-selected={isSelected} className={optionClass} - isDisabled={isDisabled} + isDisabled={disabled} selectOption={selectOption} ref={innerRef} tabIndex={0} @@ -399,7 +399,7 @@ const SelectNext = React.forwardRef(function SelectNext( const { alwaysShowRequiredIndicator, className, - isDisabled, + disabled, dropdownMenuMaxHeight, dropdownMenuMinHeight, id, @@ -467,7 +467,7 @@ const SelectNext = React.forwardRef(function SelectNext( // @ts-ignore dropdownMenuMaxHeight={dropdownMenuMaxHeight} dropdownMenuMinHeight={dropdownMenuMinHeight} - isDisabled={isDisabled} + isDisabled={disabled} isSearchable={isSearchable} menuPortalTarget={menuPortalTarget} name={name} From 660462bc556ecb1377486e64eb9af0f8ff6db53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9COscar?= Date: Tue, 10 Oct 2023 13:31:36 -0600 Subject: [PATCH 3/3] select little fixes --- src/inputs/selectNext/selectNext.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/inputs/selectNext/selectNext.tsx b/src/inputs/selectNext/selectNext.tsx index 484572ac..0128b788 100644 --- a/src/inputs/selectNext/selectNext.tsx +++ b/src/inputs/selectNext/selectNext.tsx @@ -311,14 +311,12 @@ const CustomArrow = (componentProps) => ( {...componentProps} >
- {// @ts-ignore - - } +
);