moneyadviceservice / dough

Reusable UI components
http://www.madewithdough.org.uk/
MIT License
9 stars 1 forks source link

[DEV APPROVED] 9392 popup tip position #304

Closed davidtrussler closed 5 years ago

davidtrussler commented 5 years ago

TP9392

The Dough tooltip component currently always displays in the same position, meaning that in some circumstances it appears relatively distant from the icon that triggers it. This is particularly noticeable on the Debt Advice Locator tool and creates a confusing user experience (as below).

image

The work in this PR sets the position of the popup to be related to the trigger position (see below). This is aligned with a lateral variation depending on the trigger position relative to the centre of the page so that the popup will not display off-screen.

image