Skip to content

Inconsistencies in selectedItemTextStyle #175

@rpattcorner

Description

@rpattcorner

The selectedItemTextStyle property kindly added by @mikaello in #82 is exactly what my app needs, to let users who revisit a modal selector know what the currently selected value is.

However the property appears to show some odd behaviors. On a SampleApp modified only to add:
selectedItemTextStyle = {{color: 'red', textDecorationLine: 'underline'}}
at the beginning of the first three ModalSelector.

Here's some samples of anomalies I've seen:

Action: Open a modal, make a selection, reopen modal and see if it is highlighted by the passed TextStyle

Root case: A selection (Cherries) in the first Modal behaves as expected, showing 'Cherries" highlighted in the displayed list

Anomaly 1 Immediately repeat with the second Modal selecting 'Cranberries'. Selection is not highlighted in displayed list, suggesting either an error in that invocation or some shared state

Anomaly 2 Immediately repeat action with Modal 1 . The 'Cherries' highlight is gone. Reselect 'Cherries'

Reselect Modal 1 - 'Cherries' highlight is restored

Anomaly 3 - Retest Modal 2 entering 'Cranberries'. Modal 2 is now functioning, showing a highlighted 'Cranberries'. Interestingly if you use a different style in Anomaly 3 you'll see that the correct local style is displayed, suggesting that if there's shared state between the Modals it isn't total in any way

Anomaly 4 - Move on to Modal 3 (the switch) in the current state. Select 'Pink Grapefruit'. Reopen - 'Pink Grapefruit' is highlighted. Now revisit Modals 1 and 2. They are undisturbed, showing highlights on 'Cherries' and 'Cranberries' respectively. All appears to be working ...

So ... to me it looks like there's some kind of interaction between components. But it's not across all attributes and it has an odd pattern. Can anyone give any insight into this, or duplicate it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions