ricardoboss / Prolangle

A game about programming languages.
https://prolangle.ricardoboss.de
MIT License
2 stars 1 forks source link

Should only see one popover at a time #41

Closed chucker closed 9 months ago

chucker commented 9 months ago

Mostly fixes #31.

Also waiting on #40. See TODO in ExplanationPopover.razor.

What it does do:

✅ hides the popover if you click another popover ✅ hides the popover if you click the same popover (toggles it)

What it doesn't do:

❌ hides the popover if you click outside

ricardoboss commented 9 months ago

Can we make "hides the popover if you click outside" work somehow?

chucker commented 9 months ago

Can we make "hides the popover if you click outside" work somehow?

I gave it a few attempts, and couldn't find anything nice.

ricardoboss commented 9 months ago

You can make any HTML element focusable via tabindex=0. When opening the popover that element could be focussed and when focus on that element is lost, the popover can close.