Selaa lähdekoodia

button add keyboard control

web_access_fix
Jason Chuang 1 viikko sitten
vanhempi
commit
c9b48778ed
1 muutettua tiedostoa jossa 26 lisäystä ja 13 poistoa
  1. +26
    -13
      src/pages/Proof/Reply_Public/ProofForm.js

+ 26
- 13
src/pages/Proof/Reply_Public/ProofForm.js Näytä tiedosto

@@ -54,6 +54,7 @@ const FormPanel = ({ formData }) => {
const [isSubmitting, setIsSubmitting] = React.useState(false); const [isSubmitting, setIsSubmitting] = React.useState(false);
const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState(); const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState();
const [isNoPayment, setNoPayment] = React.useState(); const [isNoPayment, setNoPayment] = React.useState();
const fileInputRef = React.useRef(null);
const navigate = useNavigate() const navigate = useNavigate()
const params = useParams(); const params = useParams();
@@ -627,6 +628,30 @@ const FormPanel = ({ formData }) => {
</Grid> </Grid>


<Grid item xs={12} md={12} textAlign="left"> <Grid item xs={12} md={12} textAlign="left">
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Button
color="save"
variant="contained"
type="button"
aria-label={intl.formatMessage({ id: 'upload' })}
disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)}
onClick={() => {
if (fileInputRef.current) {
fileInputRef.current.click();
}
}}
onKeyDown={(event) => {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault();
if (fileInputRef.current) {
fileInputRef.current.click();
}
}
}}
>
<FormattedMessage id="upload" />
</Button>
</ThemeProvider>
<input <input
id="uploadFileBtn" id="uploadFileBtn"
name="file" name="file"
@@ -637,20 +662,8 @@ const FormPanel = ({ formData }) => {
onChange={(event) => { onChange={(event) => {
readFile(event) readFile(event)
}} }}
ref={fileInputRef}
/> />
<label htmlFor="uploadFileBtn">
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Button
color="save"
component="span"
variant="contained"
aria-label={intl.formatMessage({ id: 'upload' })}
disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)}
>
<FormattedMessage id="upload" />
</Button>
</ThemeProvider>
</label>
</Grid> </Grid>






Ladataan…
Peruuta
Tallenna