Skip to content

Commit

Permalink
Merge pull request #1987 from XiaoMi/hotfix/#1986
Browse files Browse the repository at this point in the history
Hotfix/#1986
  • Loading branch information
solarjoker committed Nov 10, 2021
2 parents 4486807 + af1138e commit c10b43c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

# 3.8.0-rc

- 新增 `Input` 组件的支持 placeholder 受控动态更新 [#1982](https://github.com/XiaoMi/hiui/issues/1982)
- 修复 `Select` 组件高亮词搜索存在正则注入 [#1972](https://github.com/XiaoMi/hiui/issues/1972)
- 修复 `Table` 组件 resizable 调节列宽功能失效 [#1970](https://github.com/XiaoMi/hiui/issues/1970)
- 修复 `Input` 组件的 placeholder 没法动态更新 [#1970](https://github.com/XiaoMi/hiui/issues/1982)
- 修复 `TimePicker` 组件使用 minusStep 当点击 clear 后会再次自动回显值 [#1986](https://github.com/XiaoMi/hiui/issues/1986)

# 3.8.0

Expand Down
4 changes: 4 additions & 0 deletions components/date-picker/components/Time.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ const Time = ({ date, onChange, timeRangePanelType, startDate, currentDate }) =>
}
const selectedEvent = useCallback(
(type, value, arrow, target) => {
// 避免空值时 点开 select 自动更新 input
// 这里的 `scroll` 是 TimeList 内部暴露的自定义事件,需要规避处理
if (target === 'scroll' && !currentDate) return

const cDate = moment(date)
const disabledList = _getDsiabledList()[type]
if (disabledList.includes(value) && arrow) {
Expand Down
5 changes: 4 additions & 1 deletion docs/demo/time-picker/section-range.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ class Demo extends React.Component {
<TimePicker
defaultValue={{start: new Date(), end: new Date()}}
type="timerange"
onChange={(date, dateString) => console.log(date, dateString)}
onChange={(date, dateString) => {
console.log('onChange: ', date, dateString)
}}
/>
)
}
}`

const DemoBase = () => <DocViewer code={code} scope={{ TimePicker }} prefix={prefix} desc={desc} />
export default DemoBase

0 comments on commit c10b43c

Please sign in to comment.