Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

申請の任意項目のファイルアップロードでファイルを作成せずに提出すると項目が表示されない #430

Open
appare45 opened this issue Jul 28, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers P-critical

Comments

@appare45
Copy link
Member

Important

#415 マージ後に作業すること

再現

https://develop.sos24-client.pages.dev/committee/form-answers/dbd8f794-96bc-4a96-8545-0abd7a67f74f

修正方法

FilesField.tsxの以下の部分をファイル数が0の場合で条件分岐する

: files &&
[...Array(files.length)].map((_, i) => {
const file = files && files[i];
if (!file) {
return;
}
const error = extensionsRegex && file.type !== sosFileType ? !extensionsRegex.test(file.name) : false;
return (
<File
key={fileIds[i]}
deleteFileFunc={() => {
if (!files) {
return;
}
if (filesDOM.current) {
const newFiles = deleteFile(files, i);
filesDOM.current.files = newFiles;
setFiles((prev) => prev.set(props.id, newFiles));
}
validateFiles();
}}
file={file}
error={error}
/>
);

これなどを使うといいかもしれない
https://github.com/sohosai/sos24-client/blob/develop/src/common_components/NoResultNotice.tsx

@appare45 appare45 added bug Something isn't working good first issue Good for newcomers P-critical labels Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers P-critical
Projects
None yet
Development

No branches or pull requests

1 participant