瀏覽代碼

button add keyboard control

web_access_fix
Jason Chuang 1 周之前
父節點
當前提交
c9b48778ed
共有 1 個文件被更改,包括 26 次插入13 次删除
  1. +26
    -13
      src/pages/Proof/Reply_Public/ProofForm.js

+ 26
- 13
src/pages/Proof/Reply_Public/ProofForm.js 查看文件

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

<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
id="uploadFileBtn"
name="file"
@@ -637,20 +662,8 @@ const FormPanel = ({ formData }) => {
onChange={(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>




Loading…
取消
儲存