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

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

Open
1 task done
xianguoGou opened this issue Mar 27, 2024 · 0 comments
Labels

Comments

@xianguoGou
Copy link

💬 前提强调

  • I have searched the issues of this repository and believe that this is not a duplicate.

🙋 描述详情/重现步骤

在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

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

No branches or pull requests

1 participant