diff --git a/docs/src/app/components/pages/discover-more/Showcase.js b/docs/src/app/components/pages/discover-more/Showcase.js index 1b0c531727725c..5b90b0d0e0e839 100644 --- a/docs/src/app/components/pages/discover-more/Showcase.js +++ b/docs/src/app/components/pages/discover-more/Showcase.js @@ -155,6 +155,12 @@ const appList = [ img: 'images/showcase/brainbok-for-pmp-capm-certification.png', link: 'https://www.brainbok.com', }, + { + title: 'HoopHubs篮圈 - 查CBA/NBA比赛数据,就上HoopHubs篮圈', + author: 'HoopHubs', + img: 'images/showcase/hoophubs-basketball-stats-tool.png', + link: 'http://www.hoophubs.com', + }, ]; const Showcase = () => ( diff --git a/docs/src/www/images/showcase/hoophubs-basketball-stats-tool.png b/docs/src/www/images/showcase/hoophubs-basketball-stats-tool.png new file mode 100644 index 00000000000000..8b8472e915939e Binary files /dev/null and b/docs/src/www/images/showcase/hoophubs-basketball-stats-tool.png differ diff --git a/src/Menu/Menu.spec.js b/src/Menu/Menu.spec.js index 2e22d8f7d77f9e..7c0ba7ea039ef1 100644 --- a/src/Menu/Menu.spec.js +++ b/src/Menu/Menu.spec.js @@ -269,12 +269,12 @@ describe('
', () => { ); - wrapper.find('.item1').simulate('touchTap'); + wrapper.find('.item1').simulate('click'); assert.strictEqual(wrapper.state('focusIndex'), 0); document.body.dispatchEvent(new window.Event('mouseup', {bubbles: true})); assert.strictEqual(wrapper.state('focusIndex'), -1); - wrapper.find('.item2').simulate('touchTap'); + wrapper.find('.item2').simulate('click'); assert.strictEqual(wrapper.state('focusIndex'), 1); document.body.dispatchEvent(new window.Event('mouseup', {bubbles: true})); assert.strictEqual(wrapper.state('focusIndex'), 1); diff --git a/src/Popover/Popover.js b/src/Popover/Popover.js index d139b6fd48bea5..df1149de23aac4 100644 --- a/src/Popover/Popover.js +++ b/src/Popover/Popover.js @@ -144,6 +144,8 @@ class Popover extends Component { this.handleResize = throttle(this.setPlacement, 100); this.handleScroll = throttle(this.setPlacement.bind(this, true), 50); + this.popoverRefs = {}; + this.state = { open: props.open, closing: false, @@ -156,7 +158,7 @@ class Popover extends Component { } componentDidMount() { - this.setPlacement(); + this.placementTimeout = setTimeout(this.setPlacement); } componentWillReceiveProps(nextProps) { @@ -208,13 +210,19 @@ class Popover extends Component { } componentDidUpdate() { - this.setPlacement(); + clearTimeout(this.placementTimeout); + this.placementTimeout = setTimeout(this.setPlacement); } componentWillUnmount() { this.handleResize.cancel(); this.handleScroll.cancel(); + if (this.placementTimeout) { + clearTimeout(this.placementTimeout); + this.placementTimeout = null; + } + if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; @@ -342,11 +350,11 @@ class Popover extends Component { return; } - if (!this.refs.layer.getLayer()) { + if (!this.popoverRefs.layer.getLayer()) { return; } - const targetEl = this.refs.layer.getLayer().children[0]; + const targetEl = this.popoverRefs.layer.getLayer().children[0]; if (!targetEl) { return; } @@ -493,7 +501,7 @@ class Popover extends Component { onKeyUp={this.handleKeyUp} />