Can't seem to use Button Group due to it allways selecting the first button from the group.
See original GitHub issueSo, I have a list of cards(like IDs) that can change through time, each card is a pdf. I have a menu that is supposed to have a button for each card, and upon clicking a button I navigate to a window that will load that pdf with react-native-pdf. My current problem is, my selectedIndex seems to not work at all. I got two possible problems, either it just comes as undefined, or it always selects the first button.
My code for the selected index and button group is basically the same as the one in the webpage but I have this inside the button group.
<ButtonGroup
onPress={() => {this.updateIndex;
this.props.navigation.navigate('Details', {
cardName: this.state.cardList[this.state.selectedIndex]})
}}
selectedIndex={selectedIndex}
buttons={buttons}
containerStyle={{height: numberOfButtons, flexDirection: 'column'}}
/>
thanks in advance for any help
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Selecting only one button from button-group - Stack Overflow
Let's suppose we have got three buttons, the user should be able to select only one button, so if user selects "Apple" then...
Read more >Radio Buttons are Synched Together. How do I fix this?
I like using the radio buttons because somehow they can only choose one ... Probably you created radio button who share the same...
Read more >Hiding first radio button in a group but keeping it pre-selected
I have a radiobutton group on a regular screen (not a selection) screen. It has five radiobuttons: SV_PHASE0. SV_PHASE1. SV_PHASE2. SV_PHASE3. SV_PHASE4.
Read more >Why can't I select objects in Word? - Microsoft Support
The Group button is unavailable. Only one shape or picture is selected. Make sure you have multiple shapes or pictures selected. You can't...
Read more >Radio Buttons: Always Select One? - Nielsen Norman Group
In traditional application design, the first radio button in the list was always selected by default. But the unbridled world of website design ......
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

I ended up finding what I was doing wrong, thanks a lot for your help though! Really appreciate it
Can you create an example on https://snack.expo.io that reproduces this?