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

新版本Tabs组件设置className生成的dom中有两个地方会加上class #12051

Closed
ty-bt opened this Issue Sep 4, 2018 · 12 comments

Comments

Projects
None yet
6 participants
@ty-bt

ty-bt commented Sep 4, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.9.1

Environment

Google Chrome 68.0.3440.106

Reproduction link

Edit on CodeSandbox

Steps to reproduce

在Tabs组件中设置className="new-tab" 在浏览器中审查元素发现 .ant-tabs 和 .ant-tabs-bar位置都增加了 new-tab 类,

What is expected?

应该只有.ant-tabs位置增加class

What is actually happening?

有两个位置都增加了class

@ant-design-bot

This comment has been minimized.

ant-design-bot commented Sep 4, 2018

Translation of this issue:


The new version of the Tabs component sets the className generated dom in two places will add class

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.9.1

Environment

Google Chrome 68.0.3440.106

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Setting className="new-tab" in the Tabs component Examines the element discovery in the browser. The new-tab class is added to both the .ant-tabs and .ant-tabs-bar locations.

What is expected?

Should only increase the class of .ant-tabs

What is actually happening?

Class has been added in two locations

@zombieJ

This comment has been minimized.

Member

zombieJ commented Sep 4, 2018

相关代码有年头了,改了可能会对用户造成 Break。还是保留着,通过配合其他 class selector 来识别是哪个吧:

https://github.com/react-component/tabs/blame/3130c2dc96dd53b413a7b0ff119cce5fd23b27f9/src/TabBarMixin.js#L63
https://github.com/react-component/tabs/blame/ff43f96cbd3ecee175689a7d9c35ba22393c6b66/src/Tabs.js#L128

@zombieJ zombieJ closed this Sep 4, 2018

@zombieJ zombieJ reopened this Sep 4, 2018

@zombieJ

This comment has been minimized.

Member

zombieJ commented Sep 4, 2018

@picodoth 看一看?

@chenshuai2144

This comment has been minimized.

Contributor

chenshuai2144 commented Sep 4, 2018

目测是 renderTabBar 带入的

@picodoth

This comment has been minimized.

Contributor

picodoth commented Sep 4, 2018

screen shot 2018-09-04 at 8 20 50 pm

codesandbox 里好像只加了一个地方啊?

@ty-bt

This comment has been minimized.

ty-bt commented Sep 4, 2018

@picodoth 这鬼地方还可以改版本 sorry 我吧版本退回去了.. 吧版本改成3.9.1就好

@picodoth picodoth closed this Sep 5, 2018

@ty-bt

This comment has been minimized.

ty-bt commented Sep 5, 2018

上一句没描述好, 我是说改成3.9.1就会有两个class, 示例链接改了.

@picodoth picodoth reopened this Sep 5, 2018

@picodoth

This comment has been minimized.

picodoth added a commit that referenced this issue Sep 5, 2018

picodoth added a commit that referenced this issue Sep 6, 2018

@IssuehuntBot

This comment has been minimized.

IssuehuntBot commented Sep 11, 2018

@BoostIO funded this issue with $15. Visit this issue on Issuehunt

@afc163 afc163 closed this in 589bafd Sep 15, 2018

@IssuehuntBot

This comment has been minimized.

IssuehuntBot commented Sep 15, 2018

@afc163 has started working. Visit this issue on Issuehunt

@IssuehuntBot

This comment has been minimized.

IssuehuntBot commented Sep 15, 2018

@IssuehuntBot

This comment has been minimized.

IssuehuntBot commented Sep 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment