File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const initialState: State = {
2828 outlinedMultiline : '' ,
2929 outlinedTextArea : '' ,
3030 outlinedColors : '' ,
31+ outlinedLongLabel : '' ,
3132 maxLengthName : '' ,
3233 flatTextSecureEntry : true ,
3334 outlineTextSecureEntry : true ,
@@ -391,6 +392,15 @@ const TextInputExample = () => {
391392 outlineColor = { pink400 }
392393 activeOutlineColor = { amber900 }
393394 />
395+ < TextInput
396+ mode = "outlined"
397+ style = { styles . inputContainerStyle }
398+ label = "Outlined with super long label which is truncating at some point"
399+ placeholder = "Type something"
400+ onChangeText = { ( outlinedLongLabel ) =>
401+ inputActionHandler ( 'outlinedLongLabel' , outlinedLongLabel )
402+ }
403+ />
394404 < View style = { styles . inputContainerStyle } >
395405 < TextInput
396406 label = "Input with helper text"
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export type State = {
3131 outlinedMultiline : string ;
3232 outlinedTextArea : string ;
3333 outlinedColors : string ;
34+ outlinedLongLabel : string ;
3435 maxLengthName : string ;
3536 flatTextSecureEntry : boolean ;
3637 outlineTextSecureEntry : boolean ;
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ const LabelBackground = ({
7070 } ) ,
7171 } ,
7272 ] ,
73+ maxWidth :
74+ parentState . labelLayout . width -
75+ 2 * placeholderStyle . paddingHorizontal ,
7376 } ,
7477 ] }
7578 numberOfLines = { 1 }
@@ -87,7 +90,7 @@ const styles = StyleSheet.create({
8790 position : 'absolute' ,
8891 top : 6 ,
8992 left : 10 ,
90- width : 8 ,
93+ width : 12 ,
9194 } ,
9295 outlinedLabel : {
9396 position : 'absolute' ,
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ exports[`correctly applies height to multiline Outline TextInput 1`] = `
250250 " translateX" : - 3 ,
251251 },
252252 ],
253- " width" : 8 ,
253+ " width" : 12 ,
254254 }
255255 }
256256 />
@@ -264,6 +264,7 @@ exports[`correctly applies height to multiline Outline TextInput 1`] = `
264264 " fontSize" : 16 ,
265265 " fontWeight" : undefined ,
266266 " left" : 18 ,
267+ " maxWidth" : - 28 ,
267268 " opacity" : 1 ,
268269 " paddingHorizontal" : 0 ,
269270 " position" : " absolute" ,
You can’t perform that action at this time.
0 commit comments