jfs-components 0.1.57 → 0.1.58
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.
- package/CHANGELOG.md +4 -0
- package/lib/commonjs/components/TextInput/TextInput.js +20 -12
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/TextInput/TextInput.js +20 -12
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/TextInput/TextInput.tsx +20 -12
- package/src/icons/registry.ts +1 -1
|
@@ -143,6 +143,14 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
|
|
|
143
143
|
|
|
144
144
|
// Convert radius to React Native format (if 99999, use a large value for fully rounded)
|
|
145
145
|
const borderRadius = radius === 99999 ? 99999 : radius;
|
|
146
|
+
|
|
147
|
+
// Row height from tokens: vertical padding above/below the text line.
|
|
148
|
+
// Applied as container `minHeight` (FormField pattern) — NOT as TextInput
|
|
149
|
+
// `lineHeight` / `minHeight`, which breaks iOS vertical centering.
|
|
150
|
+
const padV = typeof paddingVertical === 'number' ? paddingVertical : 0;
|
|
151
|
+
const textLine = typeof lineHeight === 'number' ? lineHeight : 0;
|
|
152
|
+
const iconH = typeof iconSize === 'number' ? iconSize : 0;
|
|
153
|
+
const rowMinHeight = padV * 2 + Math.max(textLine, iconH);
|
|
146
154
|
const containerStyle = {
|
|
147
155
|
flexDirection: 'row',
|
|
148
156
|
alignItems: 'center',
|
|
@@ -152,7 +160,10 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
|
|
|
152
160
|
borderStyle: 'solid',
|
|
153
161
|
borderRadius,
|
|
154
162
|
paddingHorizontal,
|
|
155
|
-
|
|
163
|
+
// Same as FormField / SuggestiveSearch: the ROW owns height via minHeight;
|
|
164
|
+
// paddingVertical on the row would fight that and let the field stretch.
|
|
165
|
+
paddingVertical: 0,
|
|
166
|
+
minHeight: rowMinHeight > 0 ? rowMinHeight : undefined,
|
|
156
167
|
gap: 8
|
|
157
168
|
};
|
|
158
169
|
const hoverStyle = isHovered ? {
|
|
@@ -163,18 +174,15 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
|
|
|
163
174
|
borderWidth: 1
|
|
164
175
|
} : {};
|
|
165
176
|
|
|
166
|
-
// ⚠️
|
|
167
|
-
// `minHeight: lineHeight` on this single-line input on iOS. Same contract as
|
|
168
|
-
// FormField / SuggestiveSearch — read before "simplifying".
|
|
177
|
+
// ⚠️ Same contract as FormField / SuggestiveSearch — do not "simplify".
|
|
169
178
|
//
|
|
170
|
-
// facebook/react-native#39145 / #28012
|
|
171
|
-
//
|
|
172
|
-
// ABOVE the glyphs
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
// font metrics and floats typed text above center.
|
|
179
|
+
// facebook/react-native#39145 / #28012 / #56774:
|
|
180
|
+
// Single-line iOS UITextField + `lineHeight` (or a tall field box) puts ALL
|
|
181
|
+
// extra space ABOVE the glyphs → placeholder/value sink. Documented fix:
|
|
182
|
+
// omit `lineHeight` on the single-line input; let the wrapper
|
|
183
|
+
// (`alignItems: 'center'` + `minHeight`) center it. UITextField centers
|
|
184
|
+
// natively when it is only as tall as its font. Do NOT pin lineHeight to
|
|
185
|
+
// fontSize (clips custom fonts / floats typed text).
|
|
178
186
|
const textInputStyle = {
|
|
179
187
|
flex: 1,
|
|
180
188
|
color: textColor,
|