Skip to content

[ DatePicker ] 日期选择器,禁用bug #1186

@lqstone

Description

@lqstone

重现链接或代码

import React from 'react'
import ReactDOM from 'react-dom'
import { DatePicker } from '@kdcloudjs/kdesign'
const Demo = () => {
  const demoStyle = {
    margin: '10px 0'
  }
  const disabledDate1 = (date) => {
    return date && date < new Date('2020-10-25')
  }
  return (
    <div
      style={{
        width: '150px'
      }}>
      <div style={demoStyle}>
        <DatePicker disabledDate={disabledDate1} picker="month" defaultValue={new Date('2020-12-26')} />
      </div>
    </div>
  )
}
ReactDOM.render(<Demo />, mountNode)

重现问题步骤

设置了禁用日期后,点击选择后年的某一个月份,选完后,再次打开面板,点击年选择,无法选择被禁用的 2020 年选择器,2020 年有10,11,12还可以选择。

Image

期望的结果是什么

年的禁用可以正确显示

实际的结果是什么

年的禁用不能正确显示

组件库版本号、浏览器信息

组件库与浏览器均为最新版本

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions