Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/InkTabBarMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ function offset(elem) {
}

function componentDidUpdate(component, init) {
// If there is no css rendered, don't generate the ink bar
// fix https://github.com/ant-design/ant-design/issues/8001
if (document.styleSheets.length === 0 ||
(document.styleSheets.length === 1 && document.styleSheets[0].rules.length === 0)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里或者应该用 document.styleSheets.every(s => s.rules.length === 0) ??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document.styleSheets 不是一个数组

return;
}
const { styles } = component.props;
const wrapNode = component.nav || component.root;
const containerOffset = offset(wrapNode);
Expand Down Expand Up @@ -98,7 +104,6 @@ function componentDidUpdate(component, init) {
}

export default {

getDefaultProps() {
return {
inkBarAnimated: true,
Expand Down