Issue Bug Closed

#77719Autocomplete position is incorrect

Robert Vock 08/31/16, 17:05 updated 10/02/18, 11:07

Description

The position of the autocomplete is incorrect, if I’ve scrolled within the editing iframe (I am using Chrome 52.)
t3editor-incorrect-position.png

This happens because the positioning uses the position of the cursor within the iframe, but does not adjust for the scrollTop of the iframe.

The fix is easy, but I am not sure, if this works for all scenarios:
https://github.com/TYPO3/TYPO3.CMS/blob/096c981961c1804a078ac0ec7f93b54d13bd8efc/typo3/sysext/t3editor/Resources/Public/JavaScript/Plugins/CodeCompletion/TsCodeCompletion.js#L472

toppos = Math.round($cursorNode.position().top + TsCodeCompletion.latestCursorNode.offsetHeight - $cursorNode.scrollTop() - $(TsCodeCompletion.codemirror.frame.contentDocument.body).scrollTop()) + 'px';

Reviews 2