Skip to content

React native Picker multilingual issue #22435

Closed
@indrsidhu

Description

@indrsidhu

Environment

Environment:
OS: Windows 10
Node: 8.11.3
Yarn: Not Found
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.1.0.0 AI-173.4907809

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: ^0.55.4 => 0.55.4

Description

I have react picker drop down, its data source is constant object which is multlangual.
mean its labels property change if language changes on fly, but its index (value) wich is record it it remain same.

But i found react native picker loose its last state when we switch language,
it drop previously selected value and start again from default value if i change language from English to esponial.

It should not happen, because if Index is same,picker should not care about changing labels from english to spanish, i loose pickers value if switch language in middle of form.

Reproducible Demo

This is my dropdown data source which switch label if locale changed
var COUNTRY_RENDER = []; this.state.countryDropdown.map(function (item, index) { COUNTRY_RENDER.push({ label: (locale == "en") ? item.name : item.name_es, value: item.id }); });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions