Skip to content

Commit 0ccaed5

Browse files
committed
Fix lumino message handling (context menu)
Without this compatibility shim (https://ipywidgets.readthedocs.io/en/stable/migration_guides.html#phosphor-lumino), we no longer handle `contextmenu` events correctly.
1 parent 7dacddf commit 0ccaed5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

js/src/_base/Renderable.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ class RenderableView extends widgets.DOMWidgetView {
197197
}
198198
}
199199

200-
processPhosphorMessage(msg) {
201-
widgets.DOMWidgetView.prototype.processPhosphorMessage.call(this, msg);
200+
_processLuminoMessage(msg, _super) {
201+
_super.call(this, msg);
202202
switch (msg.type) {
203203
case 'after-attach':
204204
this.el.addEventListener('contextmenu', this, true);
@@ -209,6 +209,14 @@ class RenderableView extends widgets.DOMWidgetView {
209209
}
210210
}
211211

212+
processPhosphorMessage(msg) {
213+
this._processLuminoMessage(msg, widgets.DOMWidgetView.prototype.processPhosphorMessage);
214+
}
215+
216+
processLuminoMessage(msg) {
217+
this._processLuminoMessage(msg, widgets.DOMWidgetView.prototype.processLuminoMessage);
218+
}
219+
212220
handleEvent(event) {
213221
switch (event.type) {
214222
case 'contextmenu':

0 commit comments

Comments
 (0)