File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed
app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments
components/src/components/Textarea Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,7 @@ export const AddComment: React.FC = () => {
4242 onChange = { e => setValue ( e . target . value ) }
4343 onKeyDown = { submitOnEnter }
4444 placeholder = "Write a comment"
45- css = { css ( { minHeight : 8 } ) }
46- style = { { lineHeight : 1.2 } }
45+ style = { { lineHeight : 1.2 , minHeight : 32 } }
4746 />
4847 </ FormField >
4948 </ form >
Original file line number Diff line number Diff line change @@ -183,7 +183,6 @@ const DialogAddComment: React.FC<{
183183 < DragHandle onPan = { onDragHandlerPan } >
184184 < Stack
185185 justify = "space-between"
186- align = "center"
187186 marginY = { 4 }
188187 marginLeft = { 4 }
189188 marginRight = { 2 }
@@ -210,6 +209,7 @@ const DialogAddComment: React.FC<{
210209 border : 'none' ,
211210 paddingLeft : 4 ,
212211 } ) }
212+ style = { { minHeight : 32 } }
213213 value = { value }
214214 onChange = { e => setValue ( e . target . value ) }
215215 placeholder = "Add comment..."
@@ -429,6 +429,7 @@ const AddReply = ({ comment, ...props }) => {
429429 borderRadius : 0 ,
430430 padding : 4 ,
431431 } ) }
432+ style = { { minHeight : 54 } }
432433 value = { value }
433434 onChange = { e => setValue ( e . target . value ) }
434435 placeholder = "Reply..."
Original file line number Diff line number Diff line change @@ -38,6 +38,16 @@ export const autoResize = () => (
3838 </ Wrapper >
3939) ;
4040
41+ export const autoResizeWithInitialHeight = ( ) => (
42+ < Wrapper >
43+ < Textarea
44+ autosize
45+ placeholder = "Write a lot of lines here"
46+ style = { { minHeight : 32 } }
47+ />
48+ </ Wrapper >
49+ ) ;
50+
4151export const Controlled = ( ) => {
4252 const [ value , setValue ] = React . useState ( '' ) ;
4353 return (
Original file line number Diff line number Diff line change @@ -79,14 +79,14 @@ export const Textarea: React.FC<ITextareaProps> = ({
7979 return (
8080 < >
8181 < Wrapper >
82- < Autosize value = { innerValue } >
82+ < Autosize value = { innerValue } style = { props . style } >
8383 { ( height : number ) => (
8484 < TextareaComponent
8585 value = { innerValue }
8686 onChange = { internalOnChange }
8787 maxLength = { maxLength }
88- style = { { height } }
8988 { ...props }
89+ style = { { ...( props . style || { } ) , height } }
9090 />
9191 ) }
9292 </ Autosize >
@@ -101,7 +101,7 @@ export const Textarea: React.FC<ITextareaProps> = ({
101101 ) ;
102102} ;
103103
104- const Autosize = ( { value, ...props } ) => (
104+ const Autosize = ( { value, style = { } , ...props } ) => (
105105 < Rect >
106106 { ( { rect, ref } ) => (
107107 < >
@@ -116,6 +116,7 @@ const Autosize = ({ value, ...props }) => (
116116 lineHeight : 1 ,
117117 minHeight : 64 ,
118118 padding : 8 ,
119+ ...style ,
119120 } }
120121 >
121122 { value + ' ' }
You can’t perform that action at this time.
0 commit comments