ButtonGroup never renders last button as final button
See original GitHub issueIssue type
I’m submitting a … (check one with “x”)
- bug report
- feature request
Issue description
Current behavior:
I want to use a ButtonGroup
like
<ButtonGroup>
<Button>Btn1</Button>
<Button>Btn2</Button>
</ButtonGroup>
and I followed the documentation. But I also tried
<ButtonGroup>
<Button>Btn1</Button>
<Button>Btn2</Button>
<Button>Btn3</Button>
</ButtonGroup>
with a third button but same thing. The last button is not rounded and the button group does not take up 100% of the width of the container.
Expected behavior:
The ButtonGroup takes up the full width of the container and rounds the last button.
Steps to reproduce:
Related code:
import {Layout, Text, Input, Button, ButtonGroup, ButtonGroupProps} from 'react-native-ui-kitten'
import styles from './styles/layout';
export default class Auth extends React.Component {
state = {
login: '',
password: '',
};
change(text, value) {
this.setState({
[value]: text,
});
}
render() {
return <Layout style={styles.layout}>
<Text category={"h2"} appearance={"hint"} style={styles.heading}>Sign In</Text>
<Input onChangeText={text => this.change(text, 'login')} value={this.state.login} label={"Email"}/>
<Input onChangeText={text => this.change(text, 'password')} value={this.state.password} label={"Password"} secureTextEntry={true}/>
<Methods/>
<Button>Log In</Button>
<Button appearance={"ghost"}>Forgot Password</Button>
</Layout>;
}
}
const Methods = props => <ButtonGroup>
<Button>Google</Button>
<Button>Facebook</Button>
</ButtonGroup>;
Other information:
OS, device, package version
Android 9.0, Galaxy S8, UI Kitten v4.1.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
Empty button at end button group after iterating through array ...
I have this empty button being generated at the end of a button group. Not sure why and attempts to prevent it from...
Read more >How to Create a ButtonGroup Component with React and ...
We use last:rounded-r-md to make the last button in the group has rounded borders on the right. If we remove <Button /> 's...
Read more >LWC - how to refresh radio button group after handleEvent ...
I have an LWC component that displays a radio button group - on selecting an option it displays a message as to ...
Read more >React: How to create a custom Button Group component in 5 ...
Render Button group component in the app. Create a new file for the Button group component. ButtonGroup.js. import React from "react"; ...
Read more >Button | Mantine
Render button or link with button styles from mantine theme. ... White is a variant in which button background color is always white...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is an idea of how you can quickly solve this - View it on Snack
The code above makes ButtonGroup have a width of a container, also it makes it children to have equal width. So it can render as expected and can be only controlled by
width
property.I don’t think that by default ButtonGroup should take the full width of a container, but we will work on it to get rid of this workaround. Thanks
sweeet, worked to perfection. Thanks everyone!