Skip to content

fix: sync clipboard on paste and focus events in LiveView - #126

Merged
rgarcia merged 2 commits into
mainfrom
fix/liveview-clipboard-sync-on-paste-and-focus
Feb 4, 2026
Merged

fix: sync clipboard on paste and focus events in LiveView#126
rgarcia merged 2 commits into
mainfrom
fix/liveview-clipboard-sync-on-paste-and-focus

Conversation

@masnwilliams

@masnwilliams masnwilliams commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Low risk UI/event-handling change limited to triggering existing clipboard sync on additional overlay events; main risk is unintended extra clipboard reads in supported browsers.

Overview
Improves LiveView clipboard freshness by triggering syncClipboard() when the overlay textarea receives paste or focus events (in addition to existing mouse-enter behavior), but only while hosting.

Includes minor template/formatting cleanups (collapsed empty <ul> in menu.vue, adjusted comment indentation, and wrapped maxWidth template literal for readability).

Written by Cursor Bugbot for commit 41dcd20. This will update automatically on new commits. Configure here.

masnwilliams and others added 2 commits January 20, 2026 17:55
Previously, clipboard sync only happened on mouseEnter events, which meant
users who tabbed back to the LiveView without moving their mouse couldn't
paste content. This adds paste and focus event handlers to sync the clipboard
when users attempt to paste or when the overlay receives focus.

Fixes KERNEL-859

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if (this.hosting) {
this.syncClipboard()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate methods with identical implementations

Low Severity

onPaste() and onOverlayFocus() are identical methods - both check this.hosting and call this.syncClipboard(). Consider either: (1) binding both @paste and @focus events to a single shared handler, or (2) having one method call the other.

Fix in Cursor Fix in Web

@rgarcia
rgarcia merged commit 943c236 into main Feb 4, 2026
5 checks passed
@rgarcia
rgarcia deleted the fix/liveview-clipboard-sync-on-paste-and-focus branch February 4, 2026 20:29
AbdulRashidReshamwala pushed a commit to reclaimprotocol/popcorn-images that referenced this pull request Mar 26, 2026
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> **Low Risk**
> Low risk UI/event-handling change limited to triggering existing
clipboard sync on additional overlay events; main risk is unintended
extra clipboard reads in supported browsers.
> 
> **Overview**
> Improves LiveView clipboard freshness by triggering `syncClipboard()`
when the overlay `textarea` receives *paste* or *focus* events (in
addition to existing mouse-enter behavior), but only while `hosting`.
> 
> Includes minor template/formatting cleanups (collapsed empty `<ul>` in
`menu.vue`, adjusted comment indentation, and wrapped `maxWidth`
template literal for readability).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
41dcd20. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants