ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.54k stars 3.7k forks source link

Bug in dropdown view leads to wrong position of dropdown when no optimal position is found #17220

Open nilsfr opened 4 weeks ago

nilsfr commented 4 weeks ago

The line with the error is the following:

optimalPanelPosition ? optimalPanelPosition.name : this._panelPositions[ 0 ].name

The problem here is that this.panelPositions[0] returns a callable. Here you get the name of the callable, not the name of the position.

The values returned by _panelPositions is defined i defaultPanelPositions.

Witoso commented 2 weeks ago

Hi! Thanks for reporting, could you provide some screens that will help us to better understand the issue.

nilsfr commented 1 week ago

I tried to fix #17225 by setting viewportTopOffseton StickyPanelView to a high number to avoid the panel becoming sticky. The result of this was that optimalPanelPosition was not found and the fallback this._panelPositions[ 0 ].name was used. But as this fallback gave the name of the function southEast and not the name of the name of the position se the classname on the dropdown was wrong, leading to the wrong position of the dropdown.

I found another solution to this so I do not have a screenshot of this, but the code here is wrong as it give the name of the function and not the name of the position.