Coder Social home page Coder Social logo

formik-chakra-ui's People

Contributors

coystark avatar dependabot[bot] avatar michaeldeboey avatar stringke avatar takethefake avatar thekaganugur avatar verekia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

formik-chakra-ui's Issues

No longer able to select by label text with React Testing library

Hello.

Steps to reproduce:

  1. Have formik-chakra-ui at version 1.4.1
  2. Clone my minimum example repo from https://github.com/PedroDBFlores/chakra-ui-formik-problem
  3. Run the tests with the current 1.4.1 version

Expected result:
Both tests should pass

Actual result:
I'm no longer able to get the selector by using the label which is labeling it.

I've checked the recent commits, might the id removal from the SelectControl have something to do with it? This might also break accessiblity by not being able to use aria-label on the select label.

Radio Group Button not updating its value

Discovered this issue with @chakra-ui/react": "1.1.0", the radio group buttons won't update its value upon selection.

This problem does not occur with version 1.0.3 as in your sandbox example.

<RadioGroupControl name="favoriteColor" label="Favorite Color" > <Radio value="#ff0000">Red</Radio> <Radio value="#00ff00">Green</Radio> <Radio value="#0000ff">Blue</Radio> </RadioGroupControl>

pass props only to input on InputControl

I'm trying to pass in a background color to the input, how can I make sure only the input receives it? bg="white"

const inputProps = {
    bg: "white"
  };

<InputControl {...inputProps} />

Not possible to pass a specific type (eg: "password") in the ```InputControl```.

Hello,
thanks a lot for this lib !
I'm trying it and i cant add a password type for the inputControl.
Like this :

<InputControl type="password" name="password" label="password" />

There is a Typescript error :

Property 'type' does not exist on type 'IntrinsicAttributes & BaseProps & { inputProps?: InputProps | undefined; } & { children?: ReactNode; }'

It's possible to do it on Chakra :

`function PasswordInput() {
const [show, setShow] = React.useState(false)
const handleClick = () => setShow(!show)

return (

<Input
pr="4.5rem"
type={show ? "text" : "password"}
placeholder="Enter password"
/>


{show ? "Hide" : "Show"}



)
}`

Thanks a lot !

Thank you for making this library

I know issues are not really for this, but thank you very much for this library. It reduces boilerplate so much!

If you need help from the community to maintain it, make sure to let us know. In the Readme or with a pinned issue for instance. Since the project is pretty small, it should be relatively easy for people to jump in and help if needed.

Cheers, and thanks again.

Remove default marginY value?

Hi @kgnugur and thanks for making my life a bit easier with this lib πŸ˜„
I decided to open a new issue on this to continue the discussion from #9. I would like the my={4} setting to be removed as well, since it eases the transition from plain Chakra UI components and users can still pass it if they want to. One might argue that a user may also pass my={0} to every component (which is what I do right now), but generally, I think, it is better practice to use a Grid with rowGap={8} for this kind of styling. My opinion though, and your opinionated lib πŸ˜‰

[QUESTION] InputLeftElement/InputRightElement with an IconButton

Hello,

I wanted to first start off by saying thank you for creating this wonderful and great package πŸ™ŒπŸ»

I was wondering if there is a way to implement Chakra UI's InputLeftElement/InputRightElement with an IconButton within your InputControl πŸ€”

Basically I would love to recreate this Chakra Pro: Login with centred form (Password Field) component to work with Formik!

Thank,
Donald Louch, CEO and Founder of DevLexicon

Non-unique id's when using CheckboxContainer

Hello Kağan! I found a small bug detailed below 😁

Steps to reproduce

<CheckboxContainer name="toppings" label="Toppings">
  <CheckboxControl name="toppings" value="cheese">
    πŸ§€ Cheese
  <CheckboxControl name="toppings" value="pineapple">
    🍍 Pineapple
  </CheckboxControl>
</CheckboxContainer>

Expected behaviour

The id attribute should be unique for the whole document. Therefore the same id can't be used on all the checkboxes within a CheckboxControl.

Current behaviour

All CheckboxControl's within a CheckboxContainer use the same id.

Environment

Version: 1.2.6

Let me know if you need any more info or help solving it
Best regards Hugo

Placeholder not working while doing TextAreaControl and InputControl

For example while doing this -

 <TextareaControl
    name="text"
    placeholder="Add your comment..."
    bg={bg}
    pt={0}
    mt={0}
    isDisabled={!data?.Me.user}
    />

The placeholder isn't visible or even present in there while checking with inspect tools.

Formik - 2.2.6
Chakra UI - 1.3.3
formik-chakra-ui - 1.4.3

ps - thanks for this library, it saves much time and complexity

customize Radio button

Hey, I want to use the following example of Radio buttons with formik
https://chakra-ui.com/docs/form/radio#custom-radio-buttons

I understand that I would need to use hooks to achieve this, but should the group property go into RadioControlGroup?

A followup question, my form has 4 radio buttons; that's a lot of hooks for a single page. Is there any other way to use custom radio buttons? I'm new to react and am not completely sure how to go about this

[SUGGESTION] Create a File Control component

import React, { ChangeEvent, ForwardedRef, useRef } from 'react'
import { EditIcon } from '@chakra-ui/icons'
import { Button, ButtonProps, InputGroup } from '@chakra-ui/react'
import { useField } from 'formik'

import { SUPPORTED_FORMATS } from 'utils/yup'

import FormControl, { BaseProps } from '../FormControl'

type FileUploadProps = {
  accept?: string
  multiple?: boolean
}

export type FileControlProps = BaseProps & FileUploadProps & { buttonProps?: ButtonProps };

export const FileControl: React.FC<FileControlProps> = React.forwardRef(
  (props: FileControlProps, ref: ForwardedRef<HTMLInputElement>) => {
    const { name, label, buttonProps, multiple = false, accept = SUPPORTED_FORMATS.join(' ,'), ...rest } = props
    const [{ onChange, ...field }, , { setValue }] = useField(name)
    const inputRef = useRef<HTMLInputElement | null>(null)

    const handleClick = () => {
      inputRef.current?.click()
    }

    const handleChange = (value: ChangeEvent<HTMLInputElement>) => {
      value.target.files && setValue(value.target.files?.[0])
    }

    return (
      <FormControl name={name} label={label} {...rest} {...ref}>
        <InputGroup onClick={handleClick}>
          <input
            onChange={handleChange}
            type='file'
            accept={accept}
            multiple={multiple}
            id={name}
            ref={inputRef}
            hidden />
          <Button w={'full'} variant={'secondary'} {...buttonProps} {...field} leftIcon={<EditIcon />} isLoading={false} paddingX={24}>
            {'Adjuntar'}
          </Button>
        </InputGroup>
      </FormControl>
    )
  }
)

export default FileControl

[SUGGESTION] Allow components to accept a `Fields` generic for name auto-completion

Allow the control components to accept a Fields type argument, similarly to the how the Formik component does in base Formik. The Fields generic would be a Record that would contain the all the valid fields and corresponding data types. This could then provide auto-completion for the name prop since every field would need to have a name that is a key of Fields.

Upload file

Hi, is there a way to upload a file using InputControl? If no may you please tell me how? I am using your example I need only to add an input file to upload image

Bug: missing ref type

Hi, I was trying to use refs with your component, but Typescript complains that there is no such prop as ref on any of your components. When I looked at the code I could see that you are explicitly typing them as Functional Components, instead of letting Typescript infer the correct type from the forwardRef function. Could you remove these explicit types?

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.