Skip to content

Commit

Permalink
Use fieldset id instead of the title in Form when rendering the Field…
Browse files Browse the repository at this point in the history
… component
  • Loading branch information
sneridagh committed Mar 25, 2024
1 parent 317c0cf commit ed30884
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/source/upgrade-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ The `.stories.mdx` extension is no longer supported.
Although it is technically possible to keep the old version running, the script `volto-update-deps` will try to update to Storybook 8 every time you run it.
```

### Form component passes down the id of the current fieldset

There was a bug that was provoking to have `id` attributes with spaces on it, if the a fieldset was longer than one word.
This was because the fieldset `title` was passed down.
The fieldset `id` is passed now instead of the `title`.
If you are relying on this for selecting fields by `id`, could be that tests could break.
If that's the case you should amend them to use the `id`.

(volto-upgrade-guide-17.x.x)=

## Upgrading to Volto 17.x.x
Expand Down
2 changes: 1 addition & 1 deletion packages/volto/src/components/manage/Form/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ class Form extends Component {
{...schema.properties[field]}
id={field}
formData={formData}
fieldSet={item.title.toLowerCase()}
fieldSet={item.id}
focus={this.state.inFocus[field]}
value={formData?.[field]}
required={schema.required.indexOf(field) !== -1}
Expand Down

0 comments on commit ed30884

Please sign in to comment.