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

File Dropzone: Add accept property #2516

Conversation

ElishaSamPeterPrabhu
Copy link
Collaborator

@ElishaSamPeterPrabhu ElishaSamPeterPrabhu commented May 10, 2024

Description

  • Added accept property to accept certain file types

References
Fixes #2003

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Copy link

netlify bot commented May 10, 2024

Deploy Preview for moduswebcomponents ready!

Name Link
🔨 Latest commit bbd71c1
🔍 Latest deploy log https://app.netlify.com/sites/moduswebcomponents/deploys/6645985839f7f300088d30bc
😎 Deploy Preview https://deploy-preview-2516--moduswebcomponents.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 26 (no change from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@coliff
Copy link
Member

coliff commented May 10, 2024

Quick few thoughts on this:

  • The property is labeled accept which I don't think is descriptive enough. Perhaps accept-file-types would be better?
  • In the docs/canvas demo it would be helpful to have an example of how exactly a file type to be added. What format does it accept them? would accept=".doc,.docx" work like input type=file does?

@ElishaSamPeterPrabhu ElishaSamPeterPrabhu self-assigned this May 13, 2024
@ElishaSamPeterPrabhu
Copy link
Collaborator Author

  • .doc,.docx

Quick few thoughts on this:

  • The property is labeled accept which I don't think is descriptive enough. Perhaps accept-file-types would be better?
  • In the docs/canvas demo it would be helpful to have an example of how exactly a file type to be added. What format does it accept them? would accept=".doc,.docx" work like input type=file does?
  • Renamed the prop to acceptFileTypes and added formats doc to the story book
  • While adding more than one format it accepts files in this way

image

  • For doc alone its accepts files in this way
    image

ElishaSamPeterPrabhu and others added 2 commits May 13, 2024 11:25
…nt-support-accept-parameter-to-avoid-users-to-upload-any-kind-of-files
@cjwinsor cjwinsor merged commit e328dae into main May 16, 2024
9 checks passed
@cjwinsor cjwinsor deleted the 2003-modusfiledropzone-at-the-moment-it-doesnt-support-accept-parameter-to-avoid-users-to-upload-any-kind-of-files branch May 16, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants