Skip to content

OnBlur doesn't work #24

@AbhayShiro

Description

@AbhayShiro

What is the current behavior?

https://codesandbox.io/s/52q597j2p

Try OnBlur event here. It doesnt fire the children function when element loses focus.

`
const WhenFieldChanges = ({ field, becomes, set, to }) => (

{(
// No subscription. We only use Field to get to the change function
{ input: { onChange } }
) => (

{({ form }) => (
<React.Fragment>

      <OnChange name={field}>
        {value => {
          if (value === becomes) {
            onChange(to);
          }
        }}
      </OnChange>
      <OnBlur  name={field}>
        {
          () => {
            console.info("got blurred sdhfghjdsgfhdsgfsdfdsjh")
          }
        }
      </OnBlur>
      </React.Fragment>
    )}
  </FormSpy>
)}
);`

It would be nice if u provide a working example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions