@cdek-it/react-native-ui-kit 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -69,12 +69,22 @@ export const InputTextBase = memo(
|
|
|
69
69
|
const toggleUserDefinedSecureTextEntry = useCallback(() => setUserDefinedSecureTextEntry((old) => !old), []);
|
|
70
70
|
const showSecureToggle = secureTextEntryProp === 'toggleable';
|
|
71
71
|
const hasRightContent = loading || showClearButton || showSecureToggle || disabled;
|
|
72
|
+
const isOnlyButton = useMemo(() => {
|
|
73
|
+
return ([showClearButton, showSecureToggle].filter((val) => val).length === 1);
|
|
74
|
+
}, [showClearButton, showSecureToggle]);
|
|
72
75
|
const rightButtonHitSlop = useMemo(() => ({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
// Большие вертикальные отступы (100) - чтобы компенсировать возможное
|
|
77
|
+
// растягивание инпута по вертикали, при этом область тапа
|
|
78
|
+
// гарантированно не выйдет за пределы инпута
|
|
79
|
+
top: 100,
|
|
80
|
+
bottom: 100,
|
|
81
|
+
left: isOnlyButton
|
|
82
|
+
? styles.rightContainer.gap
|
|
83
|
+
: styles.rightContainer.gap / 2,
|
|
84
|
+
right: isOnlyButton
|
|
85
|
+
? styles.rightContainer.gap
|
|
86
|
+
: styles.rightContainer.gap / 2,
|
|
87
|
+
}), [styles.rightContainer.gap, isOnlyButton]);
|
|
78
88
|
const texInputProps = useMemo(() => ({
|
|
79
89
|
...otherProps,
|
|
80
90
|
allowFontScaling: floatLabel ? false : otherProps.allowFontScaling,
|
package/package.json
CHANGED