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

badge 不能正确显示 #4290

Closed
yitengruntu opened this issue Dec 19, 2016 · 10 comments
Closed

badge 不能正确显示 #4290

yitengruntu opened this issue Dec 19, 2016 · 10 comments

Comments

@yitengruntu
Copy link

发生问题的环境是:

  • antd 版本: 2.5.1
  • 操作系统及其版本: Windows 10.0.14393
  • 浏览器及其版本: Chrome 55.0.2883.87 m

11482124630_ pic_hd
无法正常显示badge

@ddcat1115
Copy link
Contributor

确定浏览器没有缩放?

@yitengruntu
Copy link
Author

@ddcat1115 浏览器没有缩放 但是刚才我尝试“更改文本、应用和其他项目的大小” 从125%至100%,显示就正常了,可是现在基本win10用户都会设置为推荐的125%,请问有什么解决办法么
41482130774_ pic_hd

@benjycui
Copy link
Contributor

relative: #4176

或者 Badge 需要动态获取宽高?

@afc163
Copy link
Member

afc163 commented Dec 19, 2016

可以有,能用纯样式解决最好。现在高度在 js 里写死了。

@benjycui
Copy link
Contributor

想了下,现阶段还是要 hard code。

  1. 用 JS 动态获取元素高度,不支持 SSR。
  2. 用 em 而非 px 定义高度,不兼容 <=IE9。

ref:

renderCurrentNumber(num, i) {
const position = this.getPositionByNum(num, i);
const height = this.props.height;
const removeTransition = this.state.animateStarted ||
(getNumberArray(this.lastCount)[i] === undefined);
return createElement('span', {
className: `${this.props.prefixCls}-only`,
style: {
transition: removeTransition && 'none',
WebkitTransform: `translateY(${-position * height}px)`,
transform: `translateY(${-position * height}px)`,
height,
},
key: i,
}, this.renderNumberList(position));
}

@benjycui
Copy link
Contributor

@yitengruntu 这种系统默认缩放的问题,感觉现阶段无解。。

@yitengruntu
Copy link
Author

@benjycui 可是这种情况只发生在chrome里 国产双核浏览器,ie和ie edge都没有问题

@benjycui
Copy link
Contributor

不清楚这个的行为逻辑是怎么样的,但是出错的情况来看,就是只放大了文字。

image

@benjycui
Copy link
Contributor

benjycui commented Jan 4, 2017

有更多信息时再打开吧,没有环境不好搞。

@lock
Copy link

lock bot commented May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants