Coder Social home page Coder Social logo

Comments (4)

suparjitoteo avatar suparjitoteo commented on May 18, 2024 2

@ahmad-reza619 Hi, I believe this issue is not taken yet. Not sure if the author gonna include the fix in the next version. Not many activities here recently.

from formik-chakra-ui.

thekaganugur avatar thekaganugur commented on May 18, 2024 2

Hi, I've been really busy, and to be honest, I probably won't have time to fix ref forwarding on all components but I will release a fix for InputControl now.

Will release a new version for other components in few days.

@ahmad-reza619 I will accept PR's if you want to contribute.

Thank you.

from formik-chakra-ui.

suparjitoteo avatar suparjitoteo commented on May 18, 2024

Hi @anshuopinion ,

I think it's because the component does not forward the ref.
I have the same issue. I copied the code from the repo and forwarded the ref.
Then I import the InputControl from this newly created file instead of the package.

import { Input, InputProps } from "@chakra-ui/react";
import { useField } from "formik";
import { BaseProps, FormControl } from "formik-chakra-ui/dist/form-control";
import React from "react";
import { ForwardedRef } from "react";

export type InputControlProps = BaseProps & {
  inputProps?: InputProps;
};

export const InputControl = React.forwardRef(
  (props: InputControlProps, ref: ForwardedRef<HTMLInputElement>) => {
    const { name, label, inputProps, ...rest } = props;
    const [field] = useField(name);

    return (
      <FormControl name={name} label={label} {...rest}>
        <Input {...field} id={name} {...inputProps} ref={ref} />
      </FormControl>
    );
  }
);

export default InputControl;

from formik-chakra-ui.

ahmad-reza619 avatar ahmad-reza619 commented on May 18, 2024

Hello is this issue taken? i would like to help 😃

from formik-chakra-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.