Skip to content

Commit e617a92

Browse files
committed
place dropdown outside of editor in completion demo
this is actually much nicer-looking (don't need to scroll it into view) and safe (since you can't scroll the editor without unfocusing the dropdown)
1 parent efb4137 commit e617a92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

demo/complete.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@
6868
}
6969
sel.firstChild.selected = true;
7070
sel.size = Math.min(10, completions.length);
71-
editor.addWidget(cur, complete, true);
71+
var pos = editor.cursorCoords();
72+
complete.style.left = pos.x + "px";
73+
complete.style.top = pos.yBot + "px";
74+
document.body.appendChild(complete);
7275
// Hack to hide the scrollbar.
7376
if (completions.length <= 10)
7477
complete.style.width = (sel.clientWidth - 1) + "px";

0 commit comments

Comments
 (0)