File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed
Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,6 @@ import classnames from 'classnames';
33import { getDataAttr } from './utils' ;
44
55export default class TabBarRootNode extends React . Component {
6- componentDidUpdate ( ) {
7- const activeTab = this . props . getRef ( 'activeTab' ) ;
8- if ( activeTab ) {
9- activeTab . focus ( ) ;
10- }
11- }
12-
136 getExtraContentStyle = ( ) => {
147 const { tabBarPosition, direction } = this . props ;
158 const topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom' ;
Original file line number Diff line number Diff line change @@ -66,7 +66,6 @@ describe('<TabsComponent />', () => {
6666 which : KeyCode . RIGHT ,
6767 } ) ;
6868 expect ( tabs . at ( 0 ) . getDOMNode ( ) . className ) . toContain ( 'rc-tabs-tab-active' ) ;
69- expect ( tabs . at ( 1 ) . getDOMNode ( ) . className ) . not . toContain ( 'rc-tabs-tab-active' ) ;
7069 } ) ;
7170
7271 it ( 'first tab should be selected by default' , ( ) => {
@@ -75,16 +74,14 @@ describe('<TabsComponent />', () => {
7574 expect ( selectedTab . getDOMNode ( ) ) . toBe ( firstTab . getDOMNode ( ) ) ;
7675 } ) ;
7776
78- it ( 'switching tab via keyboard arrow navigation should move focus to new active tab' , ( ) => {
77+ it ( 'switching tab via keyboard arrow navigation should move to new active tab' , ( ) => {
7978 simulateKeyDown ( tabList . getDOMNode ( ) , KeyCode . RIGHT ) ;
80- const secondTab = tabs . at ( 1 ) ;
81- expect ( document . activeElement ) . toBe ( secondTab . getDOMNode ( ) ) ;
79+ expect ( tabs . at ( 1 ) . getDOMNode ( ) . className ) . toContain ( 'rc-tabs-tab-active' ) ;
8280 } ) ;
8381
84- it ( 'clicking a tab should move focus to this tab' , ( ) => {
85- const thirdTab = tabs . at ( 2 ) ;
86- thirdTab . simulate ( 'click' ) ;
87- expect ( document . activeElement ) . toBe ( thirdTab . getDOMNode ( ) ) ;
82+ it ( 'clicking a tab should active this tab' , ( ) => {
83+ tabs . at ( 2 ) . simulate ( 'click' ) ;
84+ expect ( tabs . at ( 2 ) . getDOMNode ( ) . className ) . toContain ( 'rc-tabs-tab-active' ) ;
8885 } ) ;
8986} ) ;
9087
You can’t perform that action at this time.
0 commit comments