Skip to content

Commit

Permalink
🫥 close #10348 stop shouldUseNativeValidation pass down constraint pr…
Browse files Browse the repository at this point in the history
…ops (#10350)

* 🫥 close #10348 stop shouldUseNativeValidation pass down constraint props

* fix lint
  • Loading branch information
bluebill1049 committed Apr 27, 2023
1 parent d68ef91 commit edc4cec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/__tests__/useForm.server.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ describe('useForm with SSR', () => {
);
};

expect(renderToString(<App />)).toEqual(
'<div><input required="" min="2" max="2" minLength="2" maxLength="2" name="test"/></div>',
);
expect(renderToString(<App />)).toEqual('<div><input name="test"/></div>');
});

it('should support progress enhancement for form', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/logic/createFormControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ export function createFormControl<

return {
...(disabledIsDefined ? { disabled: options.disabled } : {}),
...(_options.shouldUseNativeValidation || _options.progressive
...(_options.progressive
? {
required: !!options.required,
min: getRuleValue(options.min),
Expand Down

0 comments on commit edc4cec

Please sign in to comment.