Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions example/src/Examples/TextInputExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const initialState: State = {
outlinedMultiline: '',
outlinedTextArea: '',
outlinedColors: '',
outlinedLongLabel: '',
maxLengthName: '',
flatTextSecureEntry: true,
outlineTextSecureEntry: true,
Expand Down Expand Up @@ -391,6 +392,15 @@ const TextInputExample = () => {
outlineColor={pink400}
activeOutlineColor={amber900}
/>
<TextInput
mode="outlined"
style={styles.inputContainerStyle}
label="Outlined with super long label which is truncating at some point"
placeholder="Type something"
onChangeText={(outlinedLongLabel) =>
inputActionHandler('outlinedLongLabel', outlinedLongLabel)
}
/>
<View style={styles.inputContainerStyle}>
<TextInput
label="Input with helper text"
Expand Down
1 change: 1 addition & 0 deletions example/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type State = {
outlinedMultiline: string;
outlinedTextArea: string;
outlinedColors: string;
outlinedLongLabel: string;
maxLengthName: string;
flatTextSecureEntry: boolean;
outlineTextSecureEntry: boolean;
Expand Down
5 changes: 4 additions & 1 deletion src/components/TextInput/Label/LabelBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ const LabelBackground = ({
}),
},
],
maxWidth:
parentState.labelLayout.width -
2 * placeholderStyle.paddingHorizontal,
},
]}
numberOfLines={1}
Expand All @@ -87,7 +90,7 @@ const styles = StyleSheet.create({
position: 'absolute',
top: 6,
left: 10,
width: 8,
width: 12,
},
outlinedLabel: {
position: 'absolute',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ exports[`correctly applies height to multiline Outline TextInput 1`] = `
"translateX": -3,
},
],
"width": 8,
"width": 12,
}
}
/>
Expand All @@ -263,6 +263,7 @@ exports[`correctly applies height to multiline Outline TextInput 1`] = `
"fontSize": 16,
"fontWeight": undefined,
"left": 18,
"maxWidth": -28,
"opacity": 1,
"paddingHorizontal": 0,
"position": "absolute",
Expand Down