Project

General

Profile

Actions

Bug #77719

closed

Autocomplete position is incorrect

Added by Robert Vock about 8 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
t3editor
Target version:
-
Start date:
2016-08-31
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
On Location Sprint

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

t3editor-incorrect-position.png (36.8 KB) t3editor-incorrect-position.png Robert Vock, 2016-08-31 17:05
Actions #1

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.

Actions #2

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.

Actions #3

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

Actions #4

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.

Actions #5

Updated by Jan Helke about 8 years ago

  • Sprint Focus set to On Location Sprint
Actions #6

Updated by Robert Vock about 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

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

Actions #8

Updated by Robert Vock about 8 years ago

  • Status changed from Under Review to Resolved
Actions #9

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF