Skip to content

Commit

Permalink
Merge pull request #192 from igun997/master
Browse files Browse the repository at this point in the history
added : value props on Input component
  • Loading branch information
emregudur authored Apr 10, 2023
2 parents d5f3d44 + 557cafe commit 5469fd4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ inputReferance = React.createRef()
referance={inputReferance}
placeholder='Type here...'
multiline={true}
value={inputValue}
rightButtons={<Button color='white' backgroundColor='black' text='Send' />}
/>

Expand Down Expand Up @@ -383,7 +384,7 @@ inputClear()
| maxlength | none | int | input or textarea maxlength |
| onMaxLengthExceed | none | function | called when max length exceed |
| autofocus | false | bool | input autofocus |

| value | none | string | input value |
## Button Component

```javascript
Expand Down
3 changes: 2 additions & 1 deletion src/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const Input: React.FC<IInputProps> = ({
onKeyDown={props.onKeyDown}
onKeyPress={props.onKeyPress}
onKeyUp={props.onKeyUp}
value={props.value}
/>
) : (
<textarea
Expand All @@ -102,7 +103,7 @@ const Input: React.FC<IInputProps> = ({
onKeyDown={props.onKeyDown}
onKeyPress={props.onKeyPress}
onKeyUp={props.onKeyUp}
></textarea>
>{props?.value ?? ""}</textarea>
)}
{props.rightButtons && <div className='rce-input-buttons'>{props.rightButtons}</div>}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ export interface IInputProps {
placeholder?: string
defaultValue?: string
inputStyle?: Object
value?: string
onCopy?: React.ClipboardEventHandler
onCut?: React.ClipboardEventHandler
onPaste?: React.ClipboardEventHandler
Expand Down

0 comments on commit 5469fd4

Please sign in to comment.