Skip to content

Instantly share code, notes, and snippets.

@lukegb
Created July 25, 2020 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukegb/67a17864cc2be0364fbdd02e802558f0 to your computer and use it in GitHub Desktop.
Save lukegb/67a17864cc2be0364fbdd02e802558f0 to your computer and use it in GitHub Desktop.
From 096a484096decc41122e312d52a4fd615266fe43 Mon Sep 17 00:00:00 2001
From: Luke Granger-Brown <git@lukegb.com>
Date: Sun, 26 Jul 2020 00:44:44 +0100
Subject: [PATCH 7/7] Fix gr-hovercard-behavior under Firefox.
Firefox doesn't implement toElement/fromElement (they're not in the spec,
and were implemented by Chrome apparently for compatibility with IE), but
does implement target and relatedTarget, which are part of the UI Events
spec (https://w3c.github.io/uievents/#interface-mouseevent).
Bug: Issue 13175
---
.../app/elements/shared/gr-hovercard/gr-hovercard-behavior.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/polygerrit-ui/app/elements/shared/gr-hovercard/gr-hovercard-behavior.js b/polygerrit-ui/app/elements/shared/gr-hovercard/gr-hovercard-behavior.js
index 04c3166dd5..3d5937b1fa 100644
--- a/polygerrit-ui/app/elements/shared/gr-hovercard/gr-hovercard-behavior.js
+++ b/polygerrit-ui/app/elements/shared/gr-hovercard/gr-hovercard-behavior.js
@@ -209,8 +209,8 @@ export const hovercardBehaviorMixin = superClass => class extends superClass {
// from the hovercard but now hovering over the target (to stop an annoying
// flicker effect), just return.
if (opt_e) {
- if (opt_e.toElement === this ||
- (opt_e.fromElement === this && opt_e.toElement === this._target)) {
+ if (opt_e.relatedTarget === this ||
+ (opt_e.target === this && opt_e.relatedTarget === this._target)) {
return;
}
}
--
2.27.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment