Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to paste in to text input without replacing current value #7456

Closed
2 tasks done
victorhaggqvist opened this issue May 12, 2024 · 3 comments
Closed
2 tasks done
Assignees
Labels
cleanup Low impact changes

Comments

@victorhaggqvist
Copy link

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

Unable to paste value in to text input without replacing current value. Discovered trying to paste an addition to a Wiregurad peer name, but the form would not let me do so, only replacing the current name. Same behavior with both ctrl+v and ctrl+shift+v.

I'm fairly sure this used to work, and some investigation suggests that there is indeed something hijacking the paste now.

Some searching lead me to this probably being introduced in #2217 and 388d99c.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Wiregurad
  2. Click edit a current peer
  3. Attempt to paste an addition to any text input field
  4. See error: observe current value being replaced by clipborad, even when no text was selected

Expected behavior

Clipborad value pasted at cursor in text input

Describe alternatives you considered

As mentioned in the commit that adds this, but maybe not in the way it was considered;

There is a small risk the current selector is actuall too wide

This is probably one kind of "too wide", not as in html-selector necessarily, but maybe being a bit too trigger-happy all over the place.

Consider not interfering with ctrl+shift+v and/or consider only applying this essentially force-replace behavior on inputs where which has been more vetted to "makes sense" (however that may be defined). Currently, while well-intentioned, it overdoes it a bit when there appears to be no way to escape hatch it to "make it just paste".

Screenshots
Screenshot of paste-hijacking listener
screen-2024-05-12_21:40:47

Environment

Software version used and hardware type if relevant, e.g.:
OPNsense 24.1.6-amd64
FreeBSD 13.2-RELEASE-p11
OpenSSL 3.0.13

@AdSchellevis AdSchellevis self-assigned this May 13, 2024
@AdSchellevis AdSchellevis added the cleanup Low impact changes label May 13, 2024
AdSchellevis added a commit that referenced this issue May 13, 2024
…aggresive. for #7456

To some degree I think always trimming the data isn't the issue, but not being able to paste at cursor position is impractical. this commit re-wires the paste action after trimming the clipboard data (in stead of overwriting the target field).
@AdSchellevis
Copy link
Member

@victorhaggqvist I agree the previous commit is too aggressive, 2e010a7 is probably better as it trims the clipboard data and re-injects it into the insert. Can you test and confirm? Thanks

@victorhaggqvist
Copy link
Author

Tested, can confirm, that should resolve/unbreak basic paste and resolve the immediate issue.

@AdSchellevis
Copy link
Member

@victorhaggqvist thanks for confirming!

fichtner pushed a commit that referenced this issue May 14, 2024
…aggresive. for #7456

To some degree I think always trimming the data isn't the issue, but not being able to paste at cursor position is impractical. this commit re-wires the paste action after trimming the clipboard data (in stead of overwriting the target field).

(cherry picked from commit 2e010a7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Low impact changes
Development

No branches or pull requests

2 participants