Hello guys,
We've faced an issue with context menu on several RAD controls when running on MacOS 10.14.x (Mojave) with FireFox 66.0.x (Quantum).
Using touchpad or mouse, when right clicking for context menu, it just flashed and doesn't stay open: it opens and then suddenly closes.
We are using Telerik Asp.Net Ajax version 2017.2.503.40 but it can be also replicated on your demo version:
https://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/context-menu/defaultcs.aspx
https://demos.telerik.com/aspnet-ajax/scheduler/examples/overview/defaultcs.aspx
Not sure if you can provide a fast workaround for this but I just wanted to let you know.
I've checked for some open cases before creating this thread and hope I didn't duplicate something. Please move/close it if necessary.
Regards,
Andrei V.
7 Answers, 1 is accepted
Thank you for reporting this issue to us.
Indeed, there is a problem with the context menu event in the MacOS version of FireFox. The new update might change how the events are handled and the mouseup of the right click to act as a separate event, which causes the RadContextMenu to close.
We have logged it in our feedback portal where you can subscribe and follow for any progress. As soon as we find a feasible workaround, we will share it in the feedback portal item.
If you are manually showing the menu using the show() or showAt() method, a possible workaround would be calling the method in a 100ms timeout:
<script>
function
f() {
$telerik.$(
"#wrapper"
).click(
function
(ev) {
var
menu = $find(
"<%= RadContextMenu1.ClientID %>"
);
menu.show(ev);
});
$telerik.$(
"#wrapper"
).on(
"contextmenu"
,
function
(ev) {
var
menu = $find(
"<%= RadContextMenu1.ClientID %>"
);
setTimeout(
function
() {
menu.show(ev);
}, 100);
});
// Sys.Application.remove_load(f);
}
Sys.Application.add_load(f);
</script>
As a token of gratitude for bringing this up to our attention, we have updated your Telerik points.
Regards,Peter Milchev
Progress Telerik
Hello Peter,
Thank you and sorry for my big delay. Your workaround did fix some of our problems but what about RadScheduler (time slot context menu and appointment context menu) because is these cases we don't show the context menu from javascript, it's handled by the framework, we just specify the context menu items.
<AppointmentContextMenus>
<telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
<Items>
<telerik:RadMenuItem Text="Edit" Value="Edit" PostBack="false" />
<telerik:RadMenuItem Text="Complete" Value="Complete" PostBack="false" />
</Items>
</telerik:RadSchedulerContextMenu>
</AppointmentContextMenus>
<TimeSlotContextMenus>
<telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">
<Items>
<telerik:RadMenuItem Text="Call" Value="C" PostBack="false" />
<telerik:RadMenuItem Text="Event" Value="E" PostBack="false" />
</Items>
</telerik:RadSchedulerContextMenu>
</TimeSlotContextMenus>
In this case your proposal doesn't work, I suspect.
Thanks!
Andrei V.
Hello Andrei,
I am afraid that there is no update currently on this issue.
I will raise the priority of this issue so that it is investigated sooner and a possible workaround that would cover all scenarios is researched.
Regards,
Peter Milchev
Progress Telerik
Hello guys,
Returning to this, do you have any update?
In addition to this, we have discovered other problems with context menu on MAC, but this time on Safari 12.1.2.
Right click opens the context menu and works good, but CTRL+Left CLICK (which should also be Right Click) opens the context menu and the closes it fast. The behavior can be replicated on your online demo controls.
Having a look in your js code we figured out that everything happens on following stacktrace:
- addHandler: function(e, g, h, a) {
if (!e._events) {
e._events = {};
}
var f = e._events[g];
if (!f) {
e._events[g] = f = [];
}
var b;
if ($telerik.useAttachEvent(e)) {
b = function() {
var d = {};
try {
d = $telerik._getWindow(e).event;
} catch (i) {}
return h.call(e, new Sys.UI.DomEvent(d));
};
e.attachEvent("on" + g, b);
} else {
if (e.addEventListener) {
b = function(d) {
return h.call(e, new Sys.UI.DomEvent(d)); // <====== AND HERE, THIS IS FINAL. AFTER THIS, IT BREAKS
};
e.addEventListener(g, b, false); // <========= HERE
}
}
f[f.length] = {
handler: h,
browserHandler: b,
autoRemove: a
};
if (a) {
var c = e.dispose;
if (c !== $telerik._disposeHandlers) {
e.dispose = $telerik._disposeHandlers;
if (typeof (c) !== "undefined") {
e._chainDispose = c;
}
}
}
}
- addHandlerForClassName: function(f, b, g) {
if (typeof (this._eventMap[f]) == "undefined") {
this._eventMap[f] = {};
if (this._shouldUseEventCapture(f)) {
var c = this._getDomEventDelegate();
var d = this._element;
var a = function(h) {
return c.call(d, new Sys.UI.DomEvent(h));
};
this._browserHandlers[f] = a;
d.addEventListener(f, a, true);
} else {
$telerik.addHandler(this._element, f, this._getDomEventDelegate()); // <======= HERE
}
}
var e = this._eventMap[f];
e[b] = g;
}
- this._eventMap.addHandlerForClassName("contextmenu", "rsApt", this._onAppointmentContextMenu);
Having the stacktrace above, after
b = function(d) {
return h.call(e, new Sys.UI.DomEvent(d));
};
the context menu opens and closes (using CTRL + Left CLICK).
The difference of 'd' (mouse event) between 'Right Click' and 'Ctrl + Left Click' I figured out is that when CRTL+ Left CLICK, d.Buttons = 2 (I suppose that 2 buttons were clicked), d.Button = 2(assume it is left mouse button) and d.CtrlKey = True. We were trying to modify several properties at runtime in debugger but couldn't fix/find the cause.
Thanks,
Andrei V.
Hello Andrei,
We have re-tested the ContextMenus in the demos again with FireFox 68, and it seems that only the Ctrl+Left Click closed the menu immediately.
Then, we updated FireFox to the latest 69 version and it seems that the context menu works properly with Right click, Ctrl + Left Click, and on all demos, ContexMenu, Grid and Scheduler.
Can you please confirm that upgrading FireFox resolves the issues?
Regarding the, Ctrl + Left Click in Safari, the menu did flicker as it was in FireFox. The good thing is that it was properly opened with Right Click. We will try to find out if a temporary workaround is available until they hopefully fix it in an upcoming release.
Regards,
Peter Milchev
Progress Telerik
Hello Peter,
Yes I can confirm that Firefox 69 resolved the Right Click and CTRL+Click on Mac.
Right Click also works on Safari and the last issue which is still in pending is CTRL+ Click on Safari.
Thanks for your response!
Andrei V.