diff options
Diffstat (limited to 'src/content/content.js')
| -rw-r--r-- | src/content/content.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/content/content.js b/src/content/content.js index fa5f416..07e6cdc 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -630,12 +630,20 @@ document.addEventListener('mouseup', onSelectionEvent, { passive: true }); document.addEventListener('keyup', onSelectionEvent, { passive: true }); - // Reposition or hide UI when the viewport changes (Design 5.4). + // Reposition the UI while the viewport changes (Design 5.4). Keep the + // icon visible whenever a selection exists - hiding it on scroll left + // users without any way to translate until they re-selected. window.addEventListener( 'scroll', () => { if (popover.state === POPOVER_STATES.HIDDEN) { - actionButton.hide(); + const selection = readSelection(); + if (selection) { + currentSelectionRect = selection.rect; + actionButton.show(selection.rect); + } else { + actionButton.hide(); + } return; } const selection = readSelection(); |
