Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/tabcomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,17 @@
);
}


// Propagate scroll events from element <source> to element <destination>.
function follow_scroll(source, destination) {
source.bind("input keydown keyup focus blur click change scroll", function() {
setTimeout(function() {
destination.scrollTop(source.scrollTop());
destination.scrollLeft(source.scrollLeft());
}, 0);
});
}

// Show placeholder text.
// This works by creating a copy of the input and placing it behind
// the real input.
Expand Down Expand Up @@ -226,6 +237,7 @@
clone.css({
position: "absolute",
});
follow_scroll(input, clone);
}

var hint = "";
Expand Down