File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 11import React , { useState } from 'react'
2- // eslint-disable-next-line no-unused-vars
32import PropTypes from 'prop-types'
3+ import TextareaAutosize from 'react-textarea-autosize'
4+
45function useInputValue ( defaultValue ) {
56 const [ value , setValue ] = useState ( defaultValue )
67
@@ -26,19 +27,18 @@ function AddCard({ onCreate, onDeleteAll }) {
2627 }
2728 }
2829
29- function onEnter ( e ) {
30- if ( e . keyCode === 13 ) {
31- submitHandler ( ) ;
32- }
33- }
34-
3530 return (
3631
3732 < div className = "container" >
3833 < div className = "row my-2 text-center" >
3934
4035 < div className = "col-lg-12 col-md-12 p-1" >
41- < input onKeyDown = { onEnter } type = "text" className = "form-control" placeholder = "Card text" id = "Text" { ...input . bind } />
36+ < TextareaAutosize type = "text" className = "form-control" placeholder = "Card text" id = "Text"
37+ { ...input . bind }
38+ style = { { resize : "none" } }
39+ minRows = { 1 }
40+ maxRows = { 7 }
41+ />
4242 </ div >
4343
4444 < div className = "col-lg-8 col-md-6 col-sm-4 p-1" >
You can’t perform that action at this time.
0 commit comments