Skip to content

Commit

Permalink
fix(FormRadioInput): pass value to native input
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Aug 26, 2023
1 parent 6e7f097 commit f805fd2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/FormRadioInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const FormRadioInput: React.FC<FormRadioInputProps> = ({
<StyledFormRadioInput
type="radio"
checked={innerValue === value}
value={innerValue}
name={name}
onChange={onRadioInputChange}
id={innerValue}
Expand Down
23 changes: 23 additions & 0 deletions src/stories/FormRadio.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';

import { FormRadio } from '../components/FormRadio';
import { FormRadioInput } from '../components/FormRadioInput';

const meta: Meta<typeof FormRadio> = {
title: 'FormRadio',
component: FormRadio,
};

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: () => (
<FormRadio label="Theme" name="theme" value={'light'} onChange={(v) => console.log(v)}>

Check warning on line 17 in src/stories/FormRadio.stories.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
<FormRadioInput value="system" label="System" />
<FormRadioInput value="dark" label="Dark" />
<FormRadioInput value="light" label="Light" />
</FormRadio>
),
};

0 comments on commit f805fd2

Please sign in to comment.