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

BUG-000167528 [calcite-input]: file type emits "Failed to set the 'value' property" error #9319

Open
3 of 6 tasks
bedzhist opened this issue May 11, 2024 · 1 comment
Open
3 of 6 tasks
Labels
0 - new New issues that need assignment. blocked This issue is blocked by another issue. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. calcite-components-react Issues specific to the @esri/calcite-components-react package. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - high Issue should be addressed in the current milestone, impacts component or core functionality Support Issues accepted from Esri Support.
Milestone

Comments

@bedzhist
Copy link

bedzhist commented May 11, 2024

Check existing issues

Actual Behavior

When the file type calcite-input has the 'name' attribute and is inside a form, it emits this error:
image
So when the form is submitted, file value is null.

Blocked issues: #8126

Expected Behavior

The calcite-input should not emit the error and on form submission the value shoud be read correctly.

Reproduction Sample

https://codesandbox.io/p/devbox/calcite-input-file-8yqp3n?file=%2Fsrc%2FApp.jsx%3A1%2C14 File is not accessible
https://codepen.io/djha1999/pen/OJYPeqR _Added from BUG-000167528

Reproduction Steps

  1. Open the sample
  2. Click on file input and select a file.
  3. The error appears in the console.
    4. Click on the submit button
    5. The empty value is displayed in the console.

Reproduction Version

2.8.0

Relevant Info

Was also submitted as BUG-000167528, accepted on 5/17/2024

Regression?

No response

Priority impact

p4 - not time sensitive

Impact

No response

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

N/A

The Calcite file input returns an error message when the 'name' attribute is placed within an HTML form element in Calcite Design System 2.8.1.

Salesforce ID: BUG-000167528

Salesforce Submitter: Disha Jha

Salesforce Submit Date: 5/15/2024 6:15 PM

Salesforce Bug Type: Failure/Error

Salesforce Severity: Medium

Steps to Repro:

Steps to Reproduce:

1. Open the sample application: https://codepen.io/djha1999/pen/OJYPeqR

2. Click the ‘Choose File’ to upload a file

3. Observe the following error in the console: 

DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.


Notes:

• The issue doesn’t occur when the Calcite file input with a ‘name’ attribute is used outside the HTML <form> element 

• The issue also doesn’t occur when the Calcite file input without the ‘name’ attribute is used within the HTML <form> element 

• However, the 'name' attribute is required for the form's value to get submitted as mentioned in the web development and Calcite documentation:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name

https://developers.arcgis.com/calcite-design-system/components/input/#:~:text=false-,name,-name


• The sample documentation has code snippets that show calcite-inputs with ‘name’ attribute could be added inside HTML form elements:

https://developers.arcgis.com/calcite-design-system/core-concepts/#forms

• Hence, the expected behavior would be that an HTML file input with a ‘name’ attribute is accepted within HTML forms like other Calcite inputs such as Input Number, Input Date Picker etc.




Repro Data: (n/a)

Work Around: (n/a)

Product: Calcite Design System

Functional Category: Calcite Design System

Client Platform: (n/a)

Version Found: 2.6

Planned Version Fixed: (n/a)

Comment: (n/a)

@bedzhist bedzhist added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels May 11, 2024
@github-actions github-actions bot added impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive calcite-components Issues specific to the @esri/calcite-components package. calcite-components-react Issues specific to the @esri/calcite-components-react package. labels May 11, 2024
@geospatialem geospatialem added the p - high Issue should be addressed in the current milestone, impacts component or core functionality label May 17, 2024
@geospatialem
Copy link
Member

The above is blocked by the effort of elementInternals via #8126.

Its assumed for the above we need to programmatically set the hidden input's value on for submission, which isn't currently allowed for type="file".

@geospatialem geospatialem added the blocked This issue is blocked by another issue. label Jun 4, 2024
@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Jun 4, 2024
@geospatialem geospatialem added this to the Stalled milestone Jun 4, 2024
@geospatialem geospatialem changed the title [calcite-input]: file type emits "Failed to set the 'value' property" error BUG-000167528 [calcite-input]: file type emits "Failed to set the 'value' property" error Sep 12, 2024
@geospatialem geospatialem added the Support Issues accepted from Esri Support. label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. blocked This issue is blocked by another issue. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. calcite-components-react Issues specific to the @esri/calcite-components-react package. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - high Issue should be addressed in the current milestone, impacts component or core functionality Support Issues accepted from Esri Support.
Projects
None yet
Development

No branches or pull requests

2 participants