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

Incorrect Casing of Widget Props Causes Errors #4407

Open
3 of 4 tasks
aress31 opened this issue Dec 2, 2024 · 2 comments
Open
3 of 4 tasks

Incorrect Casing of Widget Props Causes Errors #4407

aress31 opened this issue Dec 2, 2024 · 2 comments

Comments

@aress31
Copy link

aress31 commented Dec 2, 2024

Prerequisites

What theme are you using?

mui

Version

5.23.1

Current Behavior

The properties passed down to customer widget/fields have the wrong casing causing both lighthouse errors and them not being applied, see:

const createFields = () => ({
  ArrayField: AutocompleteArrayField,
});

const AutocompleteArrayField = ({
  formData,
  schema: { title },
  onChange,
  ...props
}) => {
  const handleChange = (event, newValue) => onChange(newValue);

  return (
    <Autocomplete
      freeSolo
      multiple
      options={[]}
      value={formData}
      onChange={handleChange}
      renderInput={(params) => <TextField {...params} label={title} />}
      {...props}
    />
  );
};

image

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Node:
- npm:

Anything else?

No response

@aress31 aress31 added bug needs triage Initial label given, to be assigned correct labels and assigned labels Dec 2, 2024
@aress31 aress31 changed the title Widget Wrong Casing for the Props Leads to Error Incorrect Casing of Widget Props Causes Errors Dec 4, 2024
@nickgros
Copy link
Contributor

nickgros commented Dec 6, 2024

Good catch, these props should be pulled out before we pass them along. @aress31 , would you be interested in creating a PR to fix this in the widget(s) where you notice the issue?

@nickgros nickgros added help wanted awaiting response and removed needs triage Initial label given, to be assigned correct labels and assigned awaiting response labels Dec 6, 2024
@aress31
Copy link
Author

aress31 commented Dec 6, 2024

They should not all be filtered out, just passed properly, for example the required, name, id, autofocus, autocomplete, etc. are needed, just in the proper React casing.

Also, I am not available to work on a PR.

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

2 participants