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

isObject should return false for Date as well as File, null, and Array #3292

Merged
merged 6 commits into from Dec 21, 2022

Conversation

BenBeattieHood
Copy link
Contributor

@BenBeattieHood BenBeattieHood commented Dec 12, 2022

Reasons for making this change

Without this, assigning dates to the form's value instead merges them with a default value for objects of {} (in mergeDefaultsWithFormData), which stops them being dates.

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@heath-freenome
Copy link
Member

Also, update the CHANGELOG.md file please

@BenBeattieHood
Copy link
Contributor Author

Thanks for your guidance @heath-freenome 👍 I've updated the tests and the changelog as required.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@heath-freenome
Copy link
Member

@BenBeattieHood Also, I'm guessing that you didn't have the git precommit install hook properly installed (see the docs on how to do that). Therefore, you will need to run npm run cs-format in the packages/utils directory and push the resulting formatting changes to allow the build to succeed.

BenBeattieHood and others added 4 commits December 21, 2022 15:04
Without this, assigning dates to the form's value instead merges them with a default value for objects of `{}` (in mergeDefaultsWithFormData), which stops them being dates.
@BenBeattieHood
Copy link
Contributor Author

Aah! I see that now. Thanks for the guidance & docs on this. Ok, have applied the lint formatting and rebased for a clean diff.

@heath-freenome heath-freenome merged commit aa58b00 into rjsf-team:main Dec 21, 2022
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this pull request Jun 8, 2023
rjsf-team#3292)

* Tests for existing 'isObject' functionality

* isObject should return false for Date as well as File, null, and Array

Without this, assigning dates to the form's value instead merges them with a default value for objects of `{}` (in mergeDefaultsWithFormData), which stops them being dates.

* Corrected changelog entry

* Update CHANGELOG.md

* Lint formatting tests

Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this pull request Jun 8, 2023
rjsf-team#3292)

* Tests for existing 'isObject' functionality

* isObject should return false for Date as well as File, null, and Array

Without this, assigning dates to the form's value instead merges them with a default value for objects of `{}` (in mergeDefaultsWithFormData), which stops them being dates.

* Corrected changelog entry

* Update CHANGELOG.md

* Lint formatting tests

Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants