Bug #77719
closedAutocomplete position is incorrect
100%
Description
The position of the autocomplete is incorrect, if I've scrolled within the editing iframe (I am using Chrome 52.)
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';
Files
Updated by Andreas Kienast about 8 years ago
- Status changed from New to Needs Feedback
Hi,
how can I reproduce this issue at best? I have no scrolling within the editing iframe at all. Anyway, your proposed fix looks meaningful to me.
Updated by Robert Vock about 8 years ago
Which browser were you using? I just press enter a lot to fill the editing iframe and then I scroll down a bit. (Chrome 52 on OS X with scrollbars enabled)
The proposed change would fix the issue of incorrect positioning when the autocomplete opens, but when you scroll after the autocomplete opens, the position still gets incorrect. So, the TsCodeCompletion should also register a scroll-handler and update the position of the autocomplete during scrolling.
On a side-note:
TsCodeCompletion.click appears twice within the file:
https://github.com/TYPO3/TYPO3.CMS/blob/096c981/typo3/sysext/t3editor/Resources/Public/JavaScript/Plugins/CodeCompletion/TsCodeCompletion.js#L228
https://github.com/TYPO3/TYPO3.CMS/blob/096c981/typo3/sysext/t3editor/Resources/Public/JavaScript/Plugins/CodeCompletion/TsCodeCompletion.js#L333
I'll prepare a fix.
Updated by Gerrit Code Review about 8 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49706
Updated by Robert Vock about 8 years ago
I've tested the changed JS with Safari, Chrome and Firefox on OS X and with IE 11 in a Virtual Machine.
Updated by Robert Vock about 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset daa3a8121af5a964568dcf4bb64ac02dab49dd5a.
Updated by Gerrit Code Review about 8 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50304
Updated by Robert Vock about 8 years ago
- Status changed from Under Review to Resolved
Applied in changeset 27b16b3b531878e96e059088393225e38aae315c.