Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DropdownList] is not refreshing text #547

Open
@grzegorzdec

Description

@grzegorzdec

When property text is updated in DropdownList nothing happened on IOS (DropdownList text stays the same).

code to reproduce:

import React from "react";
import { View, DropdownList, DropdownListItem, LinearLayout, Text, Scene, Prism } from "magic-script-components";

export default class MyApp extends React.Component {
  constructor(props) {
    super(props);

    this.stateList = [
      "New",
      "In Progress",
      "On Hold",
      "Resolved",
      "Closed",
      "Canceled"
    ];

    this.state = { selectedState: "Select" };
  }

  onSelectedStateChanged = event => {
    if (event.SelectedItems.length > 0) {
      const item = event.SelectedItems[0];
      this.setState({ selectedState: item.label });
    }
  };

  render() {
    const { selectedState } = this.state;

    return (
      <Scene>
        <Prism size={[1, 1, 0.2]} >
          <View name="main-view" localPosition={this.props.localPosition} >
            <LinearLayout
              alignment={'center-center'}
              defaultItemAlignment={'center-center'}
              defaultItemPadding={[0.03, 0.03, 0.03, 0.03]}
              orientation={'horizontal'}
            >
              <Text textSize={0.03}>State:</Text>
              <DropdownList
                textSize={0.03}
                text={selectedState}
                onSelectionChanged={this.onSelectedStateChanged}
              >
                {this.stateList.map((item, index) => (
                  <DropdownListItem key={item} id={index} label={item} />
                ))}
              </DropdownList>
            </LinearLayout>
          </View>
        </Prism>
      </Scene>
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingiOSRelated to iOS platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions