A file upload component.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props | object | Component props. Properties
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
ref | object | | Ref to the component. |
- Since
- 1.1.15
The file upload component.
- Type:
- JSX.
Element
import FileUpload from '@gravityforms/components/react/admin/elements/FileUpload';
return <FileUpload name="file-upload" />;
Methods
(inner) handleRemove() → {void}
Handler for removing file from file upload field.
- Since
- 1.1.15
- Type:
- void
(inner) onFileInputChange(event) → {void}
Handler for change event on file input.
Name | Type | Description |
---|---|---|
event | object | Event object. |
- Since
- 1.1.15
- Type:
- void
(inner) onFileInputKeyDown(event) → {void}
Handler for keydown event on file input.
Name | Type | Description |
---|---|---|
event | object | Event object. |
- Since
- 2.0.1
- Type:
- void
(inner) onSelectFile(files) → {function}
Handler for selecting a file.
Name | Type | Description |
---|---|---|
files | Array | Array of files. |
- Since
- 1.1.15
Function to clear timeout.
- Type:
- function
(inner) onTargetClick(event) → {void}
Handler for click event on file drop target.
Name | Type | Description |
---|---|---|
event | object | Event object. |
- Since
- 1.1.15
- Type:
- void
(inner) renderFileOptions() → {string}
Renders allowed file type options.
- Since
- 1.1.15
String list of allowed file types.
- Type:
- string