Skip to content

Commit

Permalink
Merge pull request #557 from XiaoMi/hotfix/#335
Browse files Browse the repository at this point in the history
2.0.5
  • Loading branch information
solarjoker authored Aug 15, 2019
2 parents e5a2d0b + d4f02cb commit 550f838
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 96 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# 更新日志

## 2.0.5

- 修复 `<Tooltip />` hover 的闪烁问题 [#522](https://github.com/XiaoMi/hiui/issues/522)
- 修复 `<Upload />` maxCount 结合 onChange return false的计算错误问题 [#549](https://github.com/XiaoMi/hiui/issues/549)
- 修复 `<Dropdown />` 部分区域点击无效的问题 [#555](https://github.com/XiaoMi/hiui/issues/555)
- 修复 `<Menu />` 高亮项计算错误的问题 [#556](https://github.com/XiaoMi/hiui/issues/556)

## 2.0.4

- 修复:`DatePicker.format` 方法丢失的问题 [#540](https://github.com/XiaoMi/hiui/issues/540)
Expand Down
8 changes: 4 additions & 4 deletions components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import classNames from 'classnames'
import Button from '../button/index'
import Popper from '../popper'
import Provider from '../context'

const ItemWrapper = ({href, children}) => {
return href ? <a href={href}>{children}</a> : <React.Fragment>{children}</React.Fragment>
}
class Dropdown extends Component {
constructor (props) {
super(props)
Expand Down Expand Up @@ -131,10 +135,6 @@ class Dropdown extends Component {
String(item.title) === String(title) && 'hi-dropdown__item--active'
)

const ItemWrapper = ({href, children}) => {
return href ? <a href={href}>{children}</a> : <React.Fragment>{children}</React.Fragment>
}

return <li className={liCls} key={index} onClick={this.handlerClick.bind(this, item)}>
<ItemWrapper href={item.url}>
{(prefix || item.prefix) && <div className='hi-dropdown__item-prefix'>{prefix || item.prefix}</div>}
Expand Down
2 changes: 1 addition & 1 deletion components/menu/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Item extends Component {
index,
data
} = this.props
const isActive = activeIndex.indexOf(index) === 0
const isActive = activeIndex === index
const cls = classNames('hi-menu-item', 'hi-menu-item__title', 'hi-menu__title', `hi-menu--${level}`, {
'hi-menu-item--disabled': disabled,
'hi-menu-item--active': isActive
Expand Down
12 changes: 4 additions & 8 deletions components/popper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export default class Popper extends Component {
popperHeight = undefined

static propTypes = {
// attachEle: PropTypes.oneOfType([
// PropTypes.node
// ]).isRequired,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number]), // 为false时不设置
height: PropTypes.number,
className: PropTypes.string,
Expand All @@ -25,7 +22,7 @@ export default class Popper extends Component {
static defaultProps = {
show: false,
topGap: 2,
leftGap: 0,
leftGap: 2,
zIndex: 1060,
placement: 'bottom-start'
}
Expand Down Expand Up @@ -81,12 +78,12 @@ export default class Popper extends Component {
break

case 'left':
top = top + topGap + rect.height / 2
left = left + leftGap
top = top + rect.height / 2
left = left - leftGap
break

case 'right':
top = top + topGap + rect.height / 2
top = top + rect.height / 2
left = left + rect.width + leftGap
break
case 'right-start':
Expand Down Expand Up @@ -178,7 +175,6 @@ export default class Popper extends Component {
container.style.top = '0'
container.style.left = '0'
container.style.width = '100%'
// const child = React.Children.only(this.props.children)

document.body.appendChild(container)

Expand Down
67 changes: 23 additions & 44 deletions components/tooltip/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
&::after {
content: '';
position: absolute;
width: 5px;
height: 5px;
background: #4a4a4a;
}
}

Expand All @@ -24,11 +27,9 @@
margin-bottom: 5px;

&::after {
border: 5px solid transparent;
border-top-color: #4a4a4a;
bottom: -10px;
bottom: -2px;
left: 50%;
transform: translateX(-50%);
transform: translateX(-50%) rotate(45deg);
}
}

Expand All @@ -37,11 +38,9 @@
margin-left: 5px;

&::after {
border: 5px solid transparent;
border-right-color: #4a4a4a;
left: -10px;
left: -2px;
top: 50%;
transform: translateY(-50%);
transform: translateY(-50%) rotate(45deg);
}
}

Expand All @@ -50,11 +49,9 @@
margin-top: 5px;

&::after {
border: 5px solid transparent;
border-bottom-color: #4a4a4a;
top: -10px;
top: -2px;
left: 50%;
transform: translateX(-50%);
transform: translateX(-50%) rotate(45deg);
}
}

Expand All @@ -63,11 +60,9 @@
margin-right: 5px;

&::after {
border: 5px solid transparent;
border-left-color: #4a4a4a;
right: -10px;
right: -2px;
top: 50%;
transform: translateY(-50%);
transform: translateY(-50%) rotate(45deg);
}
}

Expand All @@ -76,11 +71,9 @@
margin-bottom: 5px;

&::after {
border: 5px solid transparent;
border-top-color: #4a4a4a;
bottom: -10px;
bottom: -2px;
left: 20%;
transform: translateX(-50%);
transform: translateX(-50%) rotate(45deg);
}
}

Expand All @@ -89,11 +82,9 @@
margin-bottom: 5px;

&::after {
border: 5px solid transparent;
border-top-color: #4a4a4a;
bottom: -10px;
bottom: -2px;
right: 10%;
transform: translateX(-50%);
transform: translateX(-50%) rotate(45deg);
}
}

Expand All @@ -102,11 +93,9 @@
margin-top: 5px;

&::after {
border: 5px solid transparent;
border-bottom-color: #4a4a4a;
top: -10px;
top: -2px;
right: 10%;
transform: translateX(-50%);
transform: translateX(-50%) rotate(45deg);
}
}

Expand All @@ -115,11 +104,9 @@
margin-top: 5px;

&::after {
border: 5px solid transparent;
border-bottom-color: #4a4a4a;
top: -10px;
top: -2px;
left: 20%;
transform: translateX(-50%);
transform: translateX(-50%) rotate(45deg);
}
}

Expand All @@ -128,9 +115,7 @@
margin-right: 5px;

&::after {
border: 5px solid transparent;
border-left-color: #4a4a4a;
right: -10px;
right: -2px;
top: 15%;
}
}
Expand All @@ -140,9 +125,7 @@
margin-right: 5px;

&::after {
border: 5px solid transparent;
border-left-color: #4a4a4a;
right: -10px;
right: -2px;
bottom: 15%;
}
}
Expand All @@ -152,9 +135,7 @@
margin-left: 5px;

&::after {
border: 5px solid transparent;
border-right-color: #4a4a4a;
left: -10px;
left: -2px;
top: 15%;
}
}
Expand All @@ -164,9 +145,7 @@
margin-left: 5px;

&::after {
border: 5px solid transparent;
border-right-color: #4a4a4a;
left: -10px;
left: -2px;
bottom: 15%;
}
}
Loading

0 comments on commit 550f838

Please sign in to comment.