-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Click Event Triggers on Complex Buttons are ignored in some environments #10366
Comments
I don't own Photoshop so I won't be able to test nor debug this problem. Can it be on nw.js as well? Maybe that could be tested |
@posva As a quick note, this issue isn't restricted to Photoshop. Just about every major Creative Cloud application supports CEP extensions - and is affected by this problem. 😕 |
It appears that this isn't quite right. The window.addEventListener('click', (evt)=>{console.log(evt.timeStamp);}); This means that a post right-click event will work as expected as long as the |
I should point out that it is possible to distinguish a CEP environment and version with standard JavaScript calls. This may be helpful for adding an environment flag. Specifically, the following snippet is designed to be inserted into the existing environment flag setup: const isAdobeCEP = inBrowser && typeof window.__adobe_cep__ !== undefined; The // In Premiere Pro 13.1.3, outputs: "{"minor":3,"micro":1,"major":9}"
window.__adobe_cep__.getCurrentApiVersion(); The version JSON returned by this function may be easily parsed and accessed: const cepVersion = JSON.parse(window.__adobe_cep_.getCurrentApiVersion());
cepVersion.major; // = 9
cepVersion.minor; // = 3
cepVersion.micro; // = 1 Hopefully this will prove helpful in some way. |
I made a standalone panel to demonstrate this but don't get the same behavior on Windows 10 and Vue 2.6.10, but I don't have a Mac to test: Any Mac user should be able to run a single terminal command: EDIT: Eric corrected me on the version, this is 2.6.10 (not 2.6.1) |
[Update: Please see this comment for more on the struck-through text below.]
Also, @Inventsable was able to verify that the |
This is affecting me as well.
Thank you @ericdrobinson for filing this issue! |
Update: My previous comment about requiring a contained element to also have an event handler was 100% a red herring. This is entirely unnecessary to get the bug to reproduce. It appears that small, fast-loading scripts result in the reported event On macOS, the event
That's easy: have the user right-click anywhere and then trigger some code that attaches a new listener! I've adjusted the JSFiddle example to account for the above to ensure a 100% reproduction rate in Adobe CEP applications (e.g. Photoshop, Premiere Pro, Illustrator, InDesign, After Effects, etc.) running on macOS. |
@posva We've narrowed the repro for this down to Adobe CEP contexts running on macOS. Adobe is aware of the problem but a fix from them will not address released applications. From what I can gather by reading this comment from @yyx990803 on #6566, there is an issue here in event dispatch/processing with respect to the micro/macro task order. Further, it appears that the code has subsequently been updated with a few workarounds "for environments that have buggy It appears that the workaround for the event ordering issue that was implemented in ba0ebd4 to address #6566 ended up breaking things for CEP-on-macOS (as it did with a few other "broken environments"). I would then propose that a solution would be to follow the examples set in 0bad7e2 and 7591b9d and simply bail out of this special-case processing when we detect that we're in the "broken environment" that is CEP-on-macOS. This can be done like so:
You will note that the above solution does not distinguish between macOS and Windows hosts (the latter of which does not have this issue). This would be for cross-platform consistency. It could easily be amended to check for macOS with something akin to the following: /mac/.test(window.navigator.platform.toLowerCase()); // True on macOS; false otherwise. I have tested this locally and the above does appear to resolve the issue. Thoughts? Concerns? |
I imagined it would be that, that's why I was asking about a nw.js version that we could target |
I have no idea about whether The User Agent reported for Premiere Pro 13.1.4 on macOS 10.14.6 is as follows:
I've asked others if they can provide the Windows equivalent. Given that the only difference between CEP's User Agent and the Chrome browsers' is the Chrome version, I'd be willing to bet it looks identical to a standard Windows Chrome User Agent for Chrome 61.0.3163.91... |
@posva Here are the two User Agent versions: From After Effects 16.1.2 on Windows 10:
From Premiere Pro 13.1.4 on macOS 10.14.6:
The CEP version determines the User Agent. See this table for a rough outline. |
Okay, thanks a lot for the research. In that case I think the best option we have here is to use the check you showed at #10366 (comment). |
@posva Sounds good to me. Do you have any input on whether or not I should add the macOS platform check to restrict the fix to macOS? If yes, do you have a suggestion on detection approach? Either of these should work:
Also, I just heard that the issue is fixed in the upcoming versions of the Adobe apps. I'm getting version information from them right now. This will allow me to further restrict the workaround to affected versions (the version check can be based on the version code I pointed to at the end of this comment). |
Here is a proposal for a snippet of code to add to event.js (somewhere around here): // #10366: CEP <= 9.3.x on macOS has a buggy Event.timeStamp implementation.
const isMacCEP93orEarlier = isCEPMac && ((maxBadMajor, maxBadMinor) => {
const version = JSON.parse(window.__adobe_cep__.getCurrentApiVersion())
return version.major <= maxBadMajor && version.minor <= maxBadMinor
})(9, 3) This In the above example, export const isCEP = inBrowser && window.__adobe_cep__ !== 'undefined'
export const isCEPMac = isCEP && UA && /mac os x/.test(UA) Does this look reasonable? Are the variable names okay? (The above code works in my environment.) |
Ideally, the program should behave the same on CEP osx vs CEP windows Other than that the checks you wrote look good |
I can confirm that @ericdrobinson's PR fixes the issue for me on Photoshop CC 2019 macOS |
Awesome! Thanks for giving it a shot @derrickb! For the record, I've tested the fix on Premiere Pro CC 2019 on macOS and everything looks good! |
Some Adobe CEP environments have a broken Event.timeStamp implementation that breaks event blocking logic. The issue specifically affects host applications running on macOS with CEP version 9.3 and below. This workaround is OS-agnostic so as to maintain identical behavior across platforms. More details can be found in issue vuejs#10366. fix vuejs#10366
Some Adobe CEP environments have a broken Event.timeStamp implementation that breaks event blocking logic. The issue specifically affects host applications running on macOS with CEP version 9.3 and below. This workaround is OS-agnostic so as to maintain identical behavior across platforms. More details can be found in issue vuejs#10366. fix vuejs#10366
Hi all, huge thank you for finding and fixing this bug. I spent the last couple days going crazy over debugging this, and I'm so happy to see this here. This bug is causing our panel to be practically unusable in production in mac environments, and I wanted to ask how I could get this bugfix into our system? I really rather not wait for this to be merged & published. Is there a way to patch a bugfix such as this? Again, huge kudos to finding and fixing this bug. EDIT: I decided to go with patch-package. EDIT 2 : I really can't seem to make it work. I am having a lot of trouble building vue from source code. I hope this gets accepted as a fix ASAP. |
Probably wouldn't work. This PR only contains fixes for the source code - no
@atwhiteley Provided you only need the ESM build, you can use the branch I prepared on my own fork of the
If you need a different build, you can do the following:
This approach works perfectly for us. |
@ericdrobinson Thanks a lot - I'm actually not a 100% sure which build we use but I'll check that now, though I think it's not the ESM one. I did fork vue and already did create a separate branch - but I ran into trouble trying to build the source code. Your response tells me I'm on the right path so I'll keep trying, thanks! UPDATE: It was my own stupid mistake that I couldn't build it, resolved it, built the files - and now my project is in good shape again in adobe premiere! |
Some Adobe CEP environments have a broken Event.timeStamp implementation that breaks event blocking logic. The issue specifically affects host applications running on macOS with CEP version 9.3 and below. This workaround is OS-agnostic so as to maintain identical behavior across platforms. More details can be found in issue vuejs#10366. fix vuejs#10366
I've just observed the same behavior in CEF 79.1.28 on Windows 10. The problem can be reproduced with the following conditions:
There is an issue reported on the CEF repo: https://bitbucket.org/chromiumembedded/cef/issues/2749/osr-results-in-weird-eventtimestamp-values Maybe someone could check if the problem can be reproduced on their Windows 10 machine. CEF builds can be downloaded via http://opensource.spotify.com/cefbuilds/index.html (I've used cef_binary_79.1.28+gf272726+chromium-79.0.3945.117_windows64_client.tar.bz2) If this is the case, then I would adapt the PR #10459 from @ericdrobinson to detect CEP and CEF. |
@joaomlemos #11031 does not mention CEP applications at all. Have you tested that PR in a CEP context? If so, which application and which version? I'm also not sure if the new logic in #11031 isn't so broad that it would negate the purpose of the check to begin with... Someone on the Vue team would need to weigh in on that. @posva perhaps? |
@ericdrobinson, I didn’t tested it with CEP applications. The issue that I’m facing is in CEF applications. The same issue was mentioned by @boardend in the comment above #10366 (comment) |
@joaomlemos Then, to be clear, you can only confirm that the proposed fix in #11031 handles the CEF case that @boardend mentioned, yes? This is important because, if so, you cannot globally declare that #11031 fixes the issue for CEP as well, which your initial comment seemed to somewhat ambiguously imply. Also, if this is the case, then it may be a good idea to comment on #11031 with a link to @boardend's comment above and mention on that PR that in your testing it seems to address the CEF problem. I would still suggest that someone more familiar with the code in question take a good look at the proposed solution in #11031 as it seems that it might be a little too "lenient". |
Right, thank you for your suggestion @ericdrobinson ! |
Solution coudn't be so "lenient" because of first check is excludes browsers with normal timestamp behaviour. The solution only extends a first crutch(e.currentTarget === e.target) |
I think the problem is actually happend with CEF (Chrome Embeded Framework) note , this question is not asked by me, that mean other people hit it too |
@John0King That may very well be a separate core issue with a similar result. While Adobe CEP does indeed build on CEF, the issue described here explicitly occurred only on macOS hosts. The CEF version in Adobe CEP is also relatively ancient, whereas the issue you posted describes far more recent versions of CEF. This issue has an associated PR that focuses the solution to as narrow a scope as possible. I would recommend opening a new issue and describe exactly the kind of values you're seeing for the event |
Some Adobe CEP environments have a broken Event.timeStamp implementation that breaks event blocking logic. The issue specifically affects host applications running on macOS with CEP version 9.3 and below. This workaround is OS-agnostic so as to maintain identical behavior across platforms. More details can be found in issue vuejs#10366. fix vuejs#10366
2022 and its still a thing... |
Version
2.6.10
Reproduction link
https://jsfiddle.net/s7hyqk13/2/
Steps to reproduce
localhost:7777
in Chrome).click
" Event Listener Breakpoint in the "Sources" tab of the Chrome Debugger.div
.What is expected?
Method bound to the
@click
handler is triggered when the image embedded in the parent div is clicked.What is actually happening?
The method bound to the
@click
handler is only triggered when clicking outside of the parent div.This is a non-trivial bug to reproduce as the only place I've experienced it is in Adobe CEP extensions (which run NW.js under the hood). That said, it does reproduce 100% of the time there.
The debugger (CEP context) seems to show several funny things at around this line in the Vue events.js file. Specifically:
e.timeStamp
value does not change between callbacks for different buttons/elements.attachedTimestamp
is significantly larger than thee.timeStamp
value.attachedTimestamp
value does change when the component is updated (thee.timeStamp
remains identical).I should note that this affects at least CEP 8.0 and CEP 9.0 (tested in Premiere Pro).
Vue Versions Note: This broke somewhere between versions 2.5.17 and 2.6.x. If we run a version of 2.5 (2.5.17 and some earlier versions verified), then this issue does not occur. In testing 2.6.x, we've found that this same issue occurs from 2.6.5 to 2.6.10 (latest). Versions of 2.6 prior to 2.6.5 are actually worse in that the buttons basically don't work at all.
Important Note: I should further note that apparently right-clicking to open the basic CEF [not CEP] context menu will cause the
e.timeStamp
values to begin reporting as expected. Once this occurs, the buttons will also work as expected. That said, we shouldn't have to instruct users to right-click prior to interfacing with the extension.The text was updated successfully, but these errors were encountered: