Skip to content

Commit

Permalink
[sitecore-jss-react-forms] Follow up to form disable bugfix (#1614)
Browse files Browse the repository at this point in the history
* Disable form when submit in progress: small inert fix

* changelog update
  • Loading branch information
art-alexeyenko authored Sep 20, 2023
1 parent ca33301 commit 548cb4b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Our versioning strategy is as follows:
* `[templates/nextjs-sxa]` Don't let Image component wrap <img> with <a> tag when TargetUrl is not configured. ([#1593](https://github.com/Sitecore/jss/issues/1593))
* `[templates/nextjs]` Next config header plugin for CORS. ([#1597](https://github.com/Sitecore/jss/pull/1597))
* `[templates/nextjs]` Ensure dictionary data is only fetched when layout data is present for a route ([#1608](https://github.com/Sitecore/jss/pull/1608))
* `[sitecore-jss-react-forms]` Form should be blocked while submit is in progress to avoid submit spam ([#1611](https://github.com/Sitecore/jss/pull/1611))
* `[sitecore-jss-react-forms]` Form should be blocked while submit is in progress to avoid submit spam ([#1611](https://github.com/Sitecore/jss/pull/1611) [#1614](https://github.com/Sitecore/jss/pull/1614))
* `[templates/nextjs]` Fix linting errors, fix type error by upgrading @react/types to v18.2.22 ([#1613](https://github.com/Sitecore/jss/pull/1613))

### 🛠 Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ describe('<Form />', () => {

c.setState({ submitInProgress: true });

expect(c.find('form').prop('inert')).to.be.true;
expect(c.find('form').prop('inert')).to.be.equal('true');
});

it('should return form to non-inert state after submit is done', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-react-forms/src/components/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection>
action={action}
method="POST"
onSubmit={this.onSubmit.bind(this)}
{...{ inert: isInert || undefined }}
{...{ inert: isInert ? 'true' : undefined }}
>
<ErrorComponent form={form} formErrors={this.state.errors} fieldErrors={fieldErrors} />
{fieldComponents}
Expand Down

0 comments on commit 548cb4b

Please sign in to comment.