**Steps to replicate the issue** (include links if applicable):
* Go to https://query.wikidata.org/querybuilder/ in a browser window wider than 608px but narrow enough so that the language selector wraps to a new line in case the language button doesn't fit in the header (e.g. in case a language with a long name is selected, such as "Chavacano de Zamboanga")
* Open the language selector itself
**What happens?**:
The language options menu is cut off, overflowing to the left of the page.
{F37489622}
And overflowing to the right in RTL languages:
{F37388819}
**What should have happened instead?**:
{F37174551}
The language options menu is visible and is aligned to the language selector button's right side.
**Other information** (browser name/version, screenshots, etc.):
Seen on Firefox 115.0.2 on Ubuntu 22.04
**Notes**
This is also occurring on Mismatch Finder https://phabricator.wikimedia.org/T343563