Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having trouble with antd-mobile 2.0 Picker and Expo v22 #2001

Closed
acomito opened this issue Oct 25, 2017 · 9 comments
Closed

Having trouble with antd-mobile 2.0 Picker and Expo v22 #2001

acomito opened this issue Oct 25, 2017 · 9 comments
Assignees

Comments

@acomito
Copy link

acomito commented Oct 25, 2017

Version

2.0.0

Environment

expo v22, iphone 7

Reproduction link

https://github.com/acomito/antd-20-expo-22

Steps to reproduce

  • download expo if you dont have it
  • make sure you have the latest versions of expo client, etc
  • clone the github repo
  • yarn install
  • run the app in expo
  • send or publish the app and send link to your iphone
  • there is only one screen which has a Picker
  • try to choose a new value, note how onOk does not fire
  • extra can't be set (always goesto default)
  • okay/dismiss text not working

What is expected?

  • extra props should work
  • okay/dismiss text props should work
  • onOk should fire

What is actually happening?

  • extra can't be set (always goes to default text in chinese)
  • okay/dismiss text not working
  • try to choose a new value, note how onOk does not fire
  • LocalProvider not working?

I used a pretty similar setup with no problems using expo v20/21 and antd-mobile pre-2.0

In general, for picker, is it better to use (for a single select) onChange or onOk?

@silentcloud
Copy link
Contributor

silentcloud commented Oct 26, 2017

@acomito

  • extra props should work
  • okay/dismiss text props should work

these have been fixed in 3b1a131 , #1984 , please wait to release

  • onOk should fire

onOk will be fired with onChange, you need use value & onChange props

state = {
   value: 'Art, Crafts, Handmade',
};
<Picker
      data={MAPPED_CATEGORY_OPTIONS}
      cols={1}
      extra="Category"
      title="Category"
      onOk={e => console.log(e)}
      okText="Okay"
      value={this.state.value}
      onChange={v => this.setState({ value: v })}
      onDismiss={e => console.log(e)}
>
    <List.Item arrow="horizontal" />
</Picker>

@acomito
Copy link
Author

acomito commented Oct 26, 2017

Thank you for your help @silentcloud

Did okText work for you when you cloned the project?

@acomito
Copy link
Author

acomito commented Oct 27, 2017

@silentcloud I'm nearly 100% okText is not taking in that reproduction repo.

@witalobenicio
Copy link

I agree with you @acomito.
I've tested right now with the most recent version, but OkText and dismissText remain chinese.

@silentcloud
Copy link
Contributor

@acomito @witalobenicio Try to use version 2.0.1, this has been released 2 days ago.

@acomito
Copy link
Author

acomito commented Oct 30, 2017

It's perfect thanks @silentcloud

@witalobenicio
Copy link

@acomito It's working now. Thanks. I'm just not able to show my selected value on the <List.Item>

@witalobenicio
Copy link

@acomito onOk is not being called yet.

@silentcloud
Copy link
Contributor

@witalobenicio onOk has been fixed in this commit 9e3069a, and will be released later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants