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

marginRight 不停改变 #22

Closed
warmhug opened this issue Dec 1, 2016 · 12 comments
Closed

marginRight 不停改变 #22

warmhug opened this issue Dec 1, 2016 · 12 comments
Assignees

Comments

@warmhug
Copy link
Contributor

warmhug commented Dec 1, 2016

gg

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

给个 codepen 重现。

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

我看 antd-mobile 里没有水平的 Steps,在哪遇到的。

@silentcloud
Copy link
Member

@afc163 新需求,这次新加的,外部用户需求 ant-design/ant-design-mobile#498

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

-              ? null : -(this.state.lastStepOffsetWidth / lastIndex + 1);
+              ? null : -Math.floor(this.state.lastStepOffsetWidth / lastIndex);

@warmhug 试试本地 node_modules 里面

? null : -(this.state.lastStepOffsetWidth / lastIndex + 1);
这行改成上面这样行不行。

@warmhug
Copy link
Contributor Author

warmhug commented Dec 1, 2016

不刷新了,不过计算位置不太对

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

还是有问题,不知道为啥 marginRight 会影响最后一个元素的宽度计算。

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

我本地重现了。

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

-              ? null : -(this.state.lastStepOffsetWidth / lastIndex + 1);
+              ? null : -Math.round(this.state.lastStepOffsetWidth / lastIndex + 1);

这样改,我本地好了。

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

你试试,没问题我发一个 patch。

@afc163 afc163 closed this as completed in f01731e Dec 1, 2016
@warmhug
Copy link
Contributor Author

warmhug commented Dec 1, 2016

不换行了,图标位置不太对,是样式写法问题?
image

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

图标位置好像和这个 bug 没关系,应该是样式实现问题。

@afc163
Copy link
Member

afc163 commented Dec 1, 2016

已发 2.2.1,重新安装。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants