|
|
|
@ -28,7 +28,7 @@ const messages = defineMessages({ |
|
|
|
|
|
|
|
|
|
let EmojiPicker, Emoji; // load asynchronously |
|
|
|
|
|
|
|
|
|
const listenerOptions = supportsPassiveEvents ? { passive: true } : false; |
|
|
|
|
const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true; |
|
|
|
|
|
|
|
|
|
const backgroundImageFn = () => `${assetHost}/emoji/sheet_13.png`; |
|
|
|
|
|
|
|
|
@ -79,12 +79,12 @@ class ModifierPickerMenu extends React.PureComponent { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
attachListeners () { |
|
|
|
|
document.addEventListener('click', this.handleDocumentClick, false); |
|
|
|
|
document.addEventListener('click', this.handleDocumentClick, { capture: true }); |
|
|
|
|
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
removeListeners () { |
|
|
|
|
document.removeEventListener('click', this.handleDocumentClick, false); |
|
|
|
|
document.removeEventListener('click', this.handleDocumentClick, { capture: true }); |
|
|
|
|
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -177,7 +177,7 @@ class EmojiPickerMenuImpl extends React.PureComponent { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
componentDidMount () { |
|
|
|
|
document.addEventListener('click', this.handleDocumentClick, false); |
|
|
|
|
document.addEventListener('click', this.handleDocumentClick, { capture: true }); |
|
|
|
|
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions); |
|
|
|
|
|
|
|
|
|
// Because of https://github.com/react-bootstrap/react-bootstrap/issues/2614 we need |
|
|
|
@ -192,7 +192,7 @@ class EmojiPickerMenuImpl extends React.PureComponent { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentWillUnmount () { |
|
|
|
|
document.removeEventListener('click', this.handleDocumentClick, false); |
|
|
|
|
document.removeEventListener('click', this.handleDocumentClick, { capture: true }); |
|
|
|
|
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|