Close context menu on resize.

pull/21833/head
Richard Lewis 2018-01-18 12:04:00 +00:00
parent 917d85d603
commit 910623d287
1 changed files with 6 additions and 1 deletions

View File

@ -59,6 +59,11 @@ module.exports = {
}
};
// Close the menu on window resize
const windowResize = function() {
closeMenu();
};
const position = {};
let chevronFace = null;
@ -135,7 +140,7 @@ module.exports = {
<div className={className} style={position}>
<div className={menuClasses} style={menuStyle}>
{ chevron }
<Element {...props} onFinished={closeMenu} />
<Element {...props} onFinished={closeMenu} onResize={windowResize} />
</div>
<div className="mx_ContextualMenu_background" onClick={closeMenu}></div>
<style>{ chevronCSS }</style>