Web: Components: fixed SelectedItem and SelectorAddButton click when components is disabled

This commit is contained in:
Nikita Gopienko 2020-12-18 15:34:36 +03:00
parent 2c818b0e71
commit 60b172e8d8
2 changed files with 10 additions and 2 deletions

View File

@ -44,6 +44,10 @@ const SelectedItem = (props) => {
const { isDisabled, text, onClose } = props;
const colorProps = { color: isDisabled ? "#D0D5DA" : "#555F65" };
const onCloseClick = (e) => {
!isDisabled && onClose && onClose(e);
};
//console.log("SelectedItem render");
return (
<StyledSelectedItem {...props}>
@ -52,7 +56,7 @@ const SelectedItem = (props) => {
{text}
</Text>
</StyledSelectedTextBox>
<StyledCloseButton onClick={onClose} isDisabled={isDisabled}>
<StyledCloseButton onClick={onCloseClick} isDisabled={isDisabled}>
<IconButton
color="#979797"
size={10}

View File

@ -26,7 +26,11 @@ const StyledButton = styled.div`
`;
const SelectorAddButton = (props) => {
const { isDisabled, title, onClick, className, id, style } = props;
const { isDisabled, title, className, id, style } = props;
const onClick = (e) => {
!isDisabled && props.onClick && props.onClick(e);
};
return (
<StyledButton