gravity-ui / uikit

Home Page:https://gravity-ui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arrow position degradation in v6

ogonkov opened this issue · comments

In v6 Popup arrow on the opposite side of the Popup

https://preview.gravity-ui.com/uikit/?path=/story/components-overlays-popover--playground&args=placement:bottom-end

With bottom-end and ltr arrow should be at the right side of popup. In Storybook it displays on the left side.

Guide with illustration with right position of arrow https://gravity-ui.com/design/guides/popup#positioning

Screenshot 2024-02-29 at 16 37 09

The sandbox on the site (UIKit-5 at the time of recording) has this behaviour. When you toggle the arrow on and off it positions differently

3brejtg.mov

In storybook some of the arrows position with an offset, especially left-start and right-start.

image

The correct behaviour of popper.js: arrow element is "center aware", arrow is trying to be as close as it can to the anchor's center on cross axis depending on its size. So basically it works as expected. Indeed there are some glitches in Storybook story rendering, that can affect positioning. Window resize helps popper to recalculate properly.