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

fix: #1573 #1574

Merged
merged 3 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# 更新日志
## 3.4.1

- 修复 `Preview` 图片预览组件,滚轮放大缩小错误 [#1573](https://github.com/XiaoMi/hiui/issues/1573)
- 修复 `TimePicker` 时间范围选择,为空时无法选择打开弹窗时的当前值 [#1530](https://github.com/XiaoMi/hiui/issues/1530)

## 3.4.0

- 优化组件弹出层自动计算合适的左右位置 [#1494](https://github.com/XiaoMi/hiui/issues/1494)
Expand Down
1 change: 1 addition & 0 deletions components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export { default as Filter } from './filter'
export { default as Drawer } from './drawer'
export { default as Search } from './search'
export { default as Slider } from './slider'
export { default as Preview } from './preview'
export { default as Popper } from './popper'
export { default as Icon } from './icon'
export { ThemeContext, LocaleContext } from './context'
2 changes: 2 additions & 0 deletions components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ export { default as Carousel } from './carousel'
export { default as Watermark } from './watermark'
export { default as Slider } from './slider'
export { default as Search } from './search'
export { default as Preview } from './preview'

export { ThemeContext, LocaleContext } from './context'
export { default as HiRequest } from './_util/hi-request'
6 changes: 2 additions & 4 deletions components/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import classNames from 'classnames'
import Icon from '../icon'
import Loading from '../loading'
import './style/index.js'
// unstable_batchedUpdates
const node = document.createElement('div')
document.body.appendChild(node)
const Preview = ({
Expand Down Expand Up @@ -129,9 +128,8 @@ const Preview = ({
)
const handleMouseWheel = useCallback(
(e) => {
e.preventDefault()
const direct = e.deltaY
if (direct !== 0) {
const direct = e.deltaY > 0 ? 1 : -1
if (direct !== 0 && e.deltaY !== 0) {
const x = e.clientX
const y = e.clientY
handleZoom(x, y, direct)
Expand Down
2 changes: 1 addition & 1 deletion docs/demo/tree/section-async.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Demo extends React.Component {
method:'get',
data:{},
params:{id:node.id},
url:'http://my-json-server.typicode.com/hiui-group/db/conditiondata',
url:'https://my-json-server.typicode.com/hiui-group/db/conditiondata',
transformResponse:(res)=>{
let data = JSON.parse(res)
if(data[0]) {
Expand Down
2 changes: 1 addition & 1 deletion site/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ module.exports = {
filter: 'Filter 筛选',
charts: 'Charts 图表',
'rich-text-editor': 'RichTextEditor 富文本编辑',
preview: 'preview 预览'
preview: 'Preview 预览'
},
designs: {
summarize: '概述',
Expand Down