Enhance FileInput to recognize user operating system for maxSize calculation
See original GitHub issueExpected Behavior
FileInput should recognize what operating system a user is on when determining if 1024
(binary) or 1000
(decimal) should be used as the conversion factor between bytes, KB, etc.
Right now, FileInput uses binary value (1024) of bytes as a conversion factor to determine if a file has exceeded the max size or not. This seems to be the better option (vs decimal conversion factor of 1000) because it ensures that all windows users will experience and accurate comparison between their file browser and Grommet’s FileInput. Previously, window’s users were being flagged by Grommet’s FileInput that their file was too large even though their file browser said it was less than the max size (their file browser used 1024, while grommet used 1000).
While our current solution provides users (regardless of their operating system) with a reasonable experience, it may be nice to enhance FileInput in the future to be slightly more intelligent.
Actual Behavior
URL, screen shot, or Codepen exhibiting the issue
Steps to Reproduce
Your Environment
- Grommet version:
- Browser Name and version:
- Operating System and version (desktop or mobile):
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Thank you so much @jcfilben and @halocline I’ll take a look!
Other references: