Skip to content

Commit b71bf51

Browse files
committed
update vc-tabs
1 parent 2e6288a commit b71bf51

16 files changed

+26
-9
lines changed

components/tabs/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Tabs from './tabs'
2-
import TabPane from './src/TabPane'
3-
import TabContent from './src/TabContent'
2+
import TabPane from '../vc-tabs/src/TabPane'
3+
import TabContent from '../vc-tabs/src/TabContent'
44
Tabs.TabPane = TabPane
55
export default Tabs
66
export { TabPane, TabContent }

components/tabs/tabs.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import Tabs from './src/Tabs'
2+
import Tabs from '../vc-tabs/src/Tabs'
33
import isFlexSupported from '../_util/isFlexSupported'
44
import { hasProp, getComponentFromProp, getComponentName, isEmptyElement } from '../_util/props-util'
55
import warning from '../_util/warning'

components/vc-pagination/Pagination.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@ export default {
9393
newState.statePageSize = val
9494
this.setState(newState)
9595
},
96+
stateCurrent(val, oldValue) {
97+
// When current page change, fix focused style of prev item
98+
// A hacky solution of https://github.com/ant-design/ant-design/issues/8948
99+
this.$nextTick(()=>{
100+
if(this.$refs.paginationNode) {
101+
const lastCurrentNode = this.$refs.paginationNode.querySelector(
102+
`.${this.prefixCls}-item-${oldValue}`
103+
);
104+
if (lastCurrentNode && document.activeElement === lastCurrentNode) {
105+
lastCurrentNode.blur();
106+
}
107+
}
108+
})
109+
},
96110
},
97111
methods: {
98112
isValid (page) {
@@ -494,6 +508,7 @@ export default {
494508
<ul
495509
class={`${prefixCls}`}
496510
unselectable='unselectable'
511+
ref='paginationNode'
497512
>
498513
{totalText}
499514
<li

components/vc-table/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// base rc-table 6.1.7 7cd6abab4a2bd55adc7a9207c23feb62c3cd015b
12
import T from './src/Table'
23
import Column from './src/Column'
34
import ColumnGroup from './src/ColumnGroup'

components/tabs/src/InkTabBarMixin.js renamed to components/vc-tabs/src/InkTabBarMixin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ function offset (elem) {
3636

3737
function componentDidUpdate (component, init) {
3838
const { styles = {}} = component.$props
39-
const wrapNode = component.$refs.nav || component.$refs.root
39+
const rootNode = component.$refs.root
40+
const wrapNode = component.$refs.nav || rootNode
4041
const containerOffset = offset(wrapNode)
4142
const inkBarNode = component.$refs.inkBar
4243
const activeTab = component.$refs.activeTab
@@ -57,7 +58,7 @@ function componentDidUpdate (component, init) {
5758
// If tabNode'width width equal to wrapNode'width when tabBarPosition is top or bottom
5859
// It means no css working, then ink bar should not have width until css is loaded
5960
// Fix https://github.com/ant-design/ant-design/issues/7564
60-
if (width === wrapNode.offsetWidth) {
61+
if (width === rootNode.offsetWidth) {
6162
width = 0
6263
} else if (styles.inkBar && styles.inkBar.width !== undefined) {
6364
width = parseFloat(styles.inkBar.width, 10)
File renamed without changes.

0 commit comments

Comments
 (0)