diff --git a/webmail/webmail.js b/webmail/webmail.js index c1c6d97..863864e 100644 --- a/webmail/webmail.js +++ b/webmail/webmail.js @@ -3005,9 +3005,13 @@ const compose = (opts, listMailboxes) => { borderRadius: '.25em', display: 'flex', flexDirection: 'column', - }), initWidth ? style({ width: initWidth + 'px' }) : [], initHeight ? style({ height: initHeight + 'px' }) : [], dom.div(css('composeResizeGrab', { position: 'absolute', marginTop: '-1em', marginLeft: '-1em', width: '1em', height: '1em', cursor: 'nw-resize' }), function mousedown(e) { + }), initWidth ? style({ width: initWidth + 'px' }) : [], initHeight ? style({ height: initHeight + 'px' }) : [], dom.div(css('composeResizeGrab', { position: 'absolute', marginTop: '-1em', marginLeft: '-1em', width: '1em', height: '1em', cursor: 'nw-resize' }), async function mousedown(e) { + // Disable pointer events on the message view. If it has an iframe with a message, + // mouse events while dragging would be consumed by the iframe, breaking our + // resize. + page.style.pointerEvents = 'none'; resizeLast = null; - startDrag(e, (e) => { + await startDrag(e, (e) => { if (resizeLast) { const bounds = composeElem.getBoundingClientRect(); const width = Math.round(bounds.width + resizeLast.x - e.clientX); @@ -3024,6 +3028,7 @@ const compose = (opts, listMailboxes) => { } resizeLast = { x: e.clientX, y: e.clientY }; }); + page.style.pointerEvents = ''; }), dom.form(css('composeForm', { flexGrow: '1', display: 'flex', diff --git a/webmail/webmail.ts b/webmail/webmail.ts index 525acd5..0798c14 100644 --- a/webmail/webmail.ts +++ b/webmail/webmail.ts @@ -1953,9 +1953,13 @@ const compose = (opts: ComposeOptions, listMailboxes: listMailboxes) => { initHeight ? style({height: initHeight+'px'}) : [], dom.div( css('composeResizeGrab', {position: 'absolute', marginTop: '-1em', marginLeft: '-1em', width: '1em', height: '1em', cursor: 'nw-resize'}), - function mousedown(e: MouseEvent) { + async function mousedown(e: MouseEvent) { + // Disable pointer events on the message view. If it has an iframe with a message, + // mouse events while dragging would be consumed by the iframe, breaking our + // resize. + page.style.pointerEvents = 'none' resizeLast = null - startDrag(e, (e: MouseEvent) => { + await startDrag(e, (e: MouseEvent) => { if (resizeLast) { const bounds = composeElem.getBoundingClientRect() const width = Math.round(bounds.width + resizeLast.x - e.clientX) @@ -1972,6 +1976,7 @@ const compose = (opts: ComposeOptions, listMailboxes: listMailboxes) => { } resizeLast = {x: e.clientX, y: e.clientY} }) + page.style.pointerEvents = '' }, ), dom.form(