diff --git a/src/components/TextInput/Adornment/TextInputAffix.tsx b/src/components/TextInput/Adornment/TextInputAffix.tsx index fe6e3daa65..21003968af 100644 --- a/src/components/TextInput/Adornment/TextInputAffix.tsx +++ b/src/components/TextInput/Adornment/TextInputAffix.tsx @@ -153,7 +153,18 @@ const TextInputAffix = ({ const textColor = getTextColor({ theme, disabled }); - const affix = ( + const content = ( + + {text} + + ); + + return ( - - {text} - + {onPress ? ( + + {content} + + ) : ( + content + )} ); - - if (onPress) { - return ( - - {affix} - - ); - } - return affix; }; TextInputAffix.displayName = 'TextInput.Affix'; diff --git a/src/components/__tests__/__snapshots__/TextInput.test.tsx.snap b/src/components/__tests__/__snapshots__/TextInput.test.tsx.snap index e3d23d7f1b..a91767a534 100644 --- a/src/components/__tests__/__snapshots__/TextInput.test.tsx.snap +++ b/src/components/__tests__/__snapshots__/TextInput.test.tsx.snap @@ -224,61 +224,54 @@ exports[`call onPress when affix adornment pressed 1`] = ` />