ant-design / ant-design-mobile-rn

Ant Design for React Native
https://rn.mobile.ant.design/
MIT License
3k stars 610 forks source link

[Bug] DatePicker在Android上设置placeholder不生效,即使设置defaultValue为undefined也不行 #1331

Open xianguoGou opened 3 months ago

xianguoGou commented 3 months ago

💬 前提强调

🙋 描述详情/重现步骤

在Android真机上,给DatePicker设置placeholder文案没有生效,具体代码如下:

import React from 'react'
import { DatePicker, List, Provider } from '@ant-design/react-native'

export default class PopupExample extends React.Component<any, any> {
  constructor(props: any) {
    super(props)
    this.state = {
      value: undefined,
    }
  }

  onChange = (value: any) => {
    this.setState({ value })
  }

  render() {
    return (
      <Provider>
        <List>
          <DatePicker
             value={this.state.value}
             placeholder="请选择"
             defaultValue={undefined}
             onChange={this.onChange}
             format="YYYY-MM-DD">
            <List.Item arrow="horizontal">选择日期</List.Item>
          </DatePicker>
        </List>
      </Provider>
    )
  }
}

💻 运行环境

Android

⚫️ npx react-native info输出信息

System: OS: Windows 11 10.0.22631 CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400 Memory: 1.43 GB / 15.78 GB Binaries: Node: version: 18.16.1 path: C:\Program Files\nodejs\node.EXE Yarn: version: 1.22.22 path: ~\AppData\Roaming\npm\yarn.CMD npm: version: 9.5.1 path: C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: AI-232.10227.8.2321.11479570 Visual Studio: Not Found Languages: Java: 17.0.10 Ruby: Not Found npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.6 wanted: ^0.73.6 react-native-windows: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: Not found newArchEnabled: Not found

补充说明

No response

inkCrazy commented 3 days ago

5.1.3都没有placeholder这个字段啊