question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getInputProps is not returning "checked" property

See original GitHub issue

Description

When I use getInputProps I expect to have access to the property checked, which is only possible via casting.

Link to Reproduction

https://codesandbox.io/s/lucid-fire-dv2s9y?file=/src/CustomRadioCard.tsx

Steps to reproduce

  1. After setting up the whole custom radio group, destruct the useRadio to access the getInputProps.
  2. Call the getInputProps and set the return to a constant, like input.
  3. If you try to access the checked property, you’ll get an error.

I used casting as a workaround, but I think this should not bet necessary, as the PropGetter should return the HTMLInput properties. image

Chakra UI Version

1.6.7

Browser

Google CHrome

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

This is my very first issue, so sorry if I’ve made a mistake. My english is not that perfect too, I’ve tried my best.

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
TylerAPfledderercommented, Mar 15, 2022

@matefgo also, check out this pull request in the Chakra docs that will add Documentation for useRadio and useRadioGroup hooks!

0reactions
stale[bot]commented, Apr 16, 2022

Hi! This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs within 5 days. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-dropzone - accessing files added by click not drop
The above code handles both drag and drop, however it only gives you the latest added files and not the entire list of...
Read more >
react-dropzone
The dropzone property getters are just two functions that return objects with ... props from getInputProps() , opening a file dialog will not...
Read more >
use-form - Mantine
@mantine/form package does not depend on any other libraries, you can use it ... getInputProps returns an object with value , onChange ,...
Read more >
react-dropzone - npm
The dropzone property getters are just two functions that return ... from getInputProps() , opening a file dialog will not be possible.
Read more >
useCheckbox - Chakra UI
const { state, getCheckboxProps, getInputProps, getLabelProps, htmlProps } = useCheckbox(props). return (. <chakra.label. display='flex'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found