Skip to content

Input is losing focus #45

@costiivanov

Description

@costiivanov
components={{
        Input: ({ value, onChange, ...rest }) => {
          return (
            <input
              value={externalState}
              onChange={(event) => {
                const newValue = event.target.value;
                setExternalState(newValue);
                onChange({ target: event.target });
              }}
             {...rest}
         )
      }
}}

If I set an external state which will trigger the main component re-render, my input will lose focus and I have to re-focus after each character I type in the input field.
Can you help me out with this issue?
@BramKaashoek
Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions