I'm trying to implement a file upload, but using SUIR <Input>
, button, label, etc.
This is strictly about the use of the elements in render.
Using regular html <label>
and <input>
elements this process works as expected.
<Form.Field>
<label>File input & upload for dataschemas & datasources</label>
<input type="file" onChange={this.fileChange} />
<Button type="submit">Upload</Button>
</Form.Field>
Now I'm trying to use SUIR <Input>
element, as well as some props with the <Button>
element for styling.
<Form.Field>
<label>File input & upload </label>
<Input type="file" onChange={this.fileChange}>
<Button
content="Choose File"
labelPosition="left"
icon="file"
/>
</Input>
<Button type="submit">Upload</Button>
</Form.Field>
You can visit the codesandbox here to get a better visual idea of what I'm talking about.
When I click Choose File
in the SUIR implementation example it does not prompt the user to chose a file from their system, whereas the regular html <input>
does. I'm not sure how to get <Input type="file ...>
in semantic to behave the same way.
useRef
.import React, { useRef } from 'react'
– Xenophobe