-
Notifications
You must be signed in to change notification settings - Fork 22
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
Backup: copy-paste support with refactor of java side events handling #231
Conversation
Deploying openchemlib-js with Cloudflare Pages
|
feels wrong to put them in this repository Refs: #229 (comment)
cd44ff7
to
e548afe
Compare
e548afe
to
5d1f3ff
Compare
ev.stopPropagation(); | ||
ev.preventDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed so browser can propagate copy-paste events.
To interact with clipboard, browser need proper user interaction
// copy-paste is handled by the clipboard event | ||
if (isMenuKey(ev) && ev.key === 'c') return; | ||
if (isMenuKey(ev) && ev.key === 'v') return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not triggering java events withfireKeyEvent
in this case, avoid double copy-paste events.
And events triggered from keyboard can't work. Need clipboard events
public StereoMolecule pasteMolecule(boolean prefer2D, int smartsMode) { | ||
Object test = null; | ||
System.out.println("test: " + test.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test.toString()
produce an error (test is null).
Theses errors was really annoying to implement copy-paste properly.
So I just changes theses method so it's a no-op
@targos I think it's working as expected, but I had to make lot of changes in Java side to implement copy-paste properly. Do you agree on this approach ? Actual approach is a bit hacky, (I also need to not propagate For me the best approach would be to refactor Do you prefer I cut this PR into one for webcomponent and another one for copy-paste system ? |
Yes, please split the PR. We always prefer to do many smaller PRs if it makes sense. |
Please don't delete branch, backup for later works on copy-paste |
with bubbles
Refs: #229