Skip to content

Conversation

@bmigirl
Copy link
Contributor

@bmigirl bmigirl commented Nov 12, 2019

Motivation

This PR solves RadioGroup clicking row with children #808

Test plan

Run the app. See Radio Button Group With Items example.

@callstack-bot
Copy link

callstack-bot commented Nov 12, 2019

Hey @mmarkusik, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

};

/**
* Radio button item allows you to press the whole row (item) instead of only the button.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Radio button item allows you to press the whole row (item) instead of only the button.
* RadioButton.Item allows you to press the whole row (item) instead of only the RadioButton.

* onValueChange={value => this.setState({ value })}
* value={this.state.value}
* >
* <RadioButtonItem label="First item" value="first" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* <RadioButtonItem label="First item" value="first" />
* <RadioButton.Item label="First item" value="first" />

* value={this.state.value}
* >
* <RadioButtonItem label="First item" value="first" />
* <RadioButtonItem label="Second item" value="second" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* <RadioButtonItem label="Second item" value="second" />
* <RadioButton.Item label="Second item" value="second" />

import RadioButton from './RadioButton';
import { RadioButtonContext, RadioButtonContextType } from './RadioButtonGroup';

type Props = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to accept style prop and pass it to the View like that: style={[styles.container, style]} so users can change flex-direction or other properties

Copy link
Contributor

@Trancever Trancever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I miss clicked, it should be "Request changes"

progressbar: ProgressBarExample,
radio: RadioButtonExample,
radioGroup: RadioButtonGroupExample,
radioButtonGroupWithItemsExample: RadioButtonGroupWithItemsExample,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be radioGroupWithItems: RadioButtonGroupWithItemsExample,

value={this.state.value}
onValueChange={(value: string) => this.setState({ value })}
>
<RadioButton.Item label="First item" value="first"></RadioButton.Item>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<RadioButton.Item label="First item" value="first" />

onValueChange={(value: string) => this.setState({ value })}
>
<RadioButton.Item label="First item" value="first"></RadioButton.Item>
<RadioButton.Item
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@Trancever Trancever merged commit e5cd6fb into callstack:master Nov 14, 2019
@Trancever Trancever deleted the feat/radio-group-item branch November 14, 2019 12:47
@hamidfzm
Copy link

hamidfzm commented Nov 24, 2019

@Trancever there is a problem with RadionButton animation. Using RadioGroup.Item disables RadioButton touchable ripple animation.

Maybe adding children property to RadioButton would be better? Or using a TouchableWithoutFeedBack only for children?

@Trancever
Copy link
Contributor

@hamidfzm Can you provide a minimal repro showing this? Can be a Snack or short gif with code sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants