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

FileUploader: prop "accept" is invalid. #2435

Closed
ggfer opened this issue Nov 3, 2020 · 4 comments
Closed

FileUploader: prop "accept" is invalid. #2435

ggfer opened this issue Nov 3, 2020 · 4 comments

Comments

@ggfer
Copy link

ggfer commented Nov 3, 2020

Describe the bug
set prop accept="png,jpg", but it doesn't work when files upload window pop up.

Code snippets

            <FileUploader className={classes.formDialogContentItemIcon}
              accept="png,jpg"
              disabled={false}
              hideInput={true}
              multiple={false}
              name={undefined}
              value={null}
              valueState="None"
              onChange={(e) => { onImageChange(e, data.id) }}
            >
              {data.icon ? <img className={classes.iconUpload} src={data.icon} /> : <Icon className={classes.iconUpload} name={"background"} tooltip="213123a" interactive={false} showTooltip={false} />}
            </FileUploader>

Expected behavior
file type excluded should have been disabled.

Screenshots
image
nothing is disabled.

UI5 Web Components for React Information
"@ui5/webcomponents": "^1.0.0-rc.9",
"@ui5/webcomponents-react": "^0.11.0",
Operating System: macos
Browser: Chrome Version 86.0.4240.111 (Official Build) (x86_64)

@MarcusNotheis
Copy link
Collaborator

Hey @ggfer,
thanks for reporting, I'll forward this issue to the UI5 Web Components Repo as the component is developed within that repository.

@MarcusNotheis MarcusNotheis transferred this issue from SAP/ui5-webcomponents-react Nov 4, 2020
@ilhan007
Copy link
Member

ilhan007 commented Nov 4, 2020

Hello @ggfer could you try adding the "." in front of the file extensions - accept=".png,.jpg".

@ilhan007 ilhan007 self-assigned this Nov 4, 2020
@ggfer
Copy link
Author

ggfer commented Nov 5, 2020

Hello @ggfer could you try adding the "." in front of the file extensions - accept=".png,.jpg".

thank you. It works.

@MarcusNotheis
Copy link
Collaborator

Hey @ilhan007, I just added a PR (#2438) which adds the description as well, wasn't clear for me as well that .s are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants