()
| 795 | }; |
| 796 | } |
| 797 | componentDidMount() { |
| 798 | this.startListeningComposition(); |
| 799 | this.startListeningToTouch(); |
| 800 | |
| 801 | if (this.props.closeMenuOnScroll && document && document.addEventListener) { |
| 802 | // Listen to all scroll events, and filter them out inside of 'onScroll' |
| 803 | document.addEventListener('scroll', this.onScroll, true); |
| 804 | } |
| 805 | |
| 806 | if (this.props.autoFocus) { |
| 807 | this.focusInput(); |
| 808 | } |
| 809 | |
| 810 | // Scroll focusedOption into view if menuIsOpen is set on mount (e.g. defaultMenuIsOpen) |
| 811 | if ( |
| 812 | this.props.menuIsOpen && |
| 813 | this.state.focusedOption && |
| 814 | this.menuListRef && |
| 815 | this.focusedOptionRef |
| 816 | ) { |
| 817 | scrollIntoView(this.menuListRef, this.focusedOptionRef); |
| 818 | } |
| 819 | if (isAppleDevice()) { |
| 820 | // eslint-disable-next-line react/no-did-mount-set-state |
| 821 | this.setState({ isAppleDevice: true }); |
| 822 | } |
| 823 | } |
| 824 | componentDidUpdate(prevProps: Props<Option, IsMulti, Group>) { |
| 825 | const { isDisabled, menuIsOpen } = this.props; |
| 826 | const { isFocused } = this.state; |
nothing calls this directly
no test coverage detected