Skip to content

Commit

Permalink
fix contextmenu cropped replace optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
YueyingLu committed May 10, 2022
1 parent 45a7840 commit 7cc0c2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ace/mouse/touch_handler.js
Expand Up @@ -72,7 +72,7 @@ exports.addTouchListeners = function(el, editor) {
if(isOpen){
var rect = editor.container.getBoundingClientRect();
if(contextMenu.offsetTop + contextMenu.offsetHeight > rect.bottom) {
contextMenu.style.top = contextMenu.offsetTop - (contextMenu.offsetHeight - contextMenu.lastChild?.offsetHeight || 0) + "px";
contextMenu.style.top = contextMenu.offsetTop - contextMenu.offsetHeight + (contextMenu.lastChild ? contextMenu.lastChild.offsetHeight : 0) + "px";
}
}else{
var cursor = editor.selection.cursor;
Expand Down

0 comments on commit 7cc0c2a

Please sign in to comment.