Does the selector selected/unselected state have any functionality?

Hi, does the selector selected/unselected state have any functionality?

I tested to check if it was referring to the state of the parent or the child, but eventually found that it is added to the selector tab div which is not used anywhere.
<div style={style_state0_elSelector_part} onClick={this.selectorSelectionChanged.bind(this, 2)}><Selector_button visualStateIndex={selectedIndex_selector === 2 ? 1 : 0} title='Potential' unselectedStateIndex='0' selectedStateIndex='2' /></div>

I thought this was a way to pass down data to the child without using a global dataslot, but that didn’t seem to be the case and no one mentioned selectedStateIndex in the forum so I thought I’d ask.

Thanks.

Hi, the selected/unselected state work in tandem with the Target component.

If the target component (let’s say a custom check box with an exaggerated check mark like this)

has two or more states, then you can assign which state you wish to use for selected/unselected.

Setting it without a target component will create a stub with no functionality.

A

Adam

1 Like

Hi @Adam_Wasserman, thank you for your reply.

That is also what I would expect but the selectedStateIndex is being sent to the Selector Tab component, rather than the Target component, instead of the Target render code, which is a Custom Checkbox in this case.

<SelectorTabs visualStateIndex={this.state.selectedIndex_selector === 0 ? 1 : 0} title='Unchecked' unselectedStateIndex='0' selectedStateIndex='1' />

You can see that it is not used in SelectorTabs code.

Here is the minimal rsproj file for your reference.

@Antti_Neonto, did we ever track this down and fix it?

A