StampyAI/stampy-ui

Citation popovers often extend far beyond viewport

Closed this issue · 7 comments

Reducing the default text size will help but it won't be enough.

Image

Assigning to me to think about some design things

I've reduced the size to a reasonable fixed height. We can revisit this after launch if users are wanting more text in the popup

Is there a way of making the height and widths dynamic so that they don't go beyond the viewport at all?

Yes, but I think the better solution would be to adjust the positioning of the modal depending on the users scroll position. I might try working on this, but I don't think its a priority

Although I do want to make it so the modal goes behind the question bar, cus currently its not doing that and it looks weird imho

Yeah agreed, I guess that's a z index thing (I learnt about that yesterday haha)

Perhaps complicated to implement but one solution could be making the popover appear above the number if there's more space in the viewport above it, or below the number if there's more space below it. That combined with the fixed height you created should be enough to keep it entirely visible I think.