Skip to content

Commit 5469fd4

Browse files
authored
Merge pull request #192 from igun997/master
added : value props on Input component
2 parents d5f3d44 + 557cafe commit 5469fd4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ inputReferance = React.createRef()
351351
referance={inputReferance}
352352
placeholder='Type here...'
353353
multiline={true}
354+
value={inputValue}
354355
rightButtons={<Button color='white' backgroundColor='black' text='Send' />}
355356
/>
356357

@@ -383,7 +384,7 @@ inputClear()
383384
| maxlength | none | int | input or textarea maxlength |
384385
| onMaxLengthExceed | none | function | called when max length exceed |
385386
| autofocus | false | bool | input autofocus |
386-
387+
| value | none | string | input value |
387388
## Button Component
388389

389390
```javascript

src/Input/Input.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const Input: React.FC<IInputProps> = ({
8282
onKeyDown={props.onKeyDown}
8383
onKeyPress={props.onKeyPress}
8484
onKeyUp={props.onKeyUp}
85+
value={props.value}
8586
/>
8687
) : (
8788
<textarea
@@ -102,7 +103,7 @@ const Input: React.FC<IInputProps> = ({
102103
onKeyDown={props.onKeyDown}
103104
onKeyPress={props.onKeyPress}
104105
onKeyUp={props.onKeyUp}
105-
></textarea>
106+
>{props?.value ?? ""}</textarea>
106107
)}
107108
{props.rightButtons && <div className='rce-input-buttons'>{props.rightButtons}</div>}
108109
</div>

src/type.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ export interface IInputProps {
801801
placeholder?: string
802802
defaultValue?: string
803803
inputStyle?: Object
804+
value?: string
804805
onCopy?: React.ClipboardEventHandler
805806
onCut?: React.ClipboardEventHandler
806807
onPaste?: React.ClipboardEventHandler

0 commit comments

Comments
 (0)