final-form / final-form/react-final-form

Providing a onChange prop for <Field> should not overwrite the internal final-form onChange function

Open
#91 7 comments 6 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### Are you submitting a **bug report** or a **feature request**?

bug report

### What is the current behavior?

When passing my own `onChange` prop it actually overwrites the `final-form` `onChange` function.

### What is the expected behavior?
When passing my own `onChange` function to the `` component **it should merge** with the internal `onChange` function of `final-form`

### Sandbox Link

https://codesandbox.io/s/w7pl6pqkrw

Try to select a value in the second dropdown. It'll fire the custom `myOnChange` function but won't select the value because it overwrites the `final-form` `onChange` function.

### What's your environment?
```
"final-form": "^3.0.0",
"react-final-form": "^2.1.1",
"react": "16.2.0",
"react-dom": "16.2.0",
```
```
node version: v8.9.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.