Skip to content

Do not pass undefined type to input - #548

Merged
erikras merged 1 commit into
final-form:masterfrom
ThiefMaster:dont-pass-undefined-type
Jul 6, 2019
Merged

Do not pass undefined type to input#548
erikras merged 1 commit into
final-form:masterfrom
ThiefMaster:dont-pass-undefined-type

Conversation

@ThiefMaster

Copy link
Copy Markdown
Contributor

Some custom widgets (such as the SingleDatePicker in react-dates) have very strict prop types, that reject unknown props. So even type={undefined} will fail the prop type check.

With this PR type is only included in input, if it's not undefined.

@codecov

codecov Bot commented Jun 24, 2019

Copy link
Copy Markdown

Codecov Report

Merging #548 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #548   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          16     16           
  Lines         228    230    +2     
  Branches       56     57    +1     
=====================================
+ Hits          228    230    +2
Impacted Files Coverage Δ
src/useField.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8674fc7...c01469b. Read the comment docs.

@erikras

erikras commented Jul 6, 2019

Copy link
Copy Markdown
Member

OH! It took me a minute to figure out what this was doing. Nice PR. 👍

Talk about an edge case! 😄

@erikras
erikras merged commit f3e7c17 into final-form:master Jul 6, 2019
@ThiefMaster
ThiefMaster deleted the dont-pass-undefined-type branch July 6, 2019 23:11
@lock

lock Bot commented Aug 6, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 6, 2019
@erikras

erikras commented Nov 18, 2019

Copy link
Copy Markdown
Member

Published in v6.3.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants