ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

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

Open nilsfr opened this issue 1 year ago • 1 comments

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.

nilsfr avatar Oct 04 '24 08:10 nilsfr

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

Witoso avatar Oct 14 '24 12:10 Witoso

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.

nilsfr avatar Oct 22 '24 09:10 nilsfr

I checked this and confirm, it returns the wrong value. This error makes the panels appear in the wrong position when the optimal position cannot be found. I suggested a fix.

Thanks for investigating, @nilsfr 🎉

Mati365 avatar Nov 04 '24 07:11 Mati365