To reproduce, please select the "All" tab first and type keywords to filter out badges until there're less than three badges.
Two badges:
One badge:
No badge:
Short answer
A fixed max-height rule is at the heart of the issue. In the 6 to 8 weeks it takes to fix this, you can use the following overrides (apologies for using !important, but since SE's rulesets also use it, there is no other way):
.popup._badge-selection {
/* prevents vertical centering of the container */
justify-content: start !important;
}
.popup._badge-selection .-list-item {
/* removes content overflow */
max-height: unset !important;
}
.popup .js-badge-list-container {
/* keeps badge horizontal alignment */
justify-content: center;
/* removes badge vertical stretch */
height: unset !important;
}
If anyone needs a quick JavaScript snippet, here it is:
((_w, d) => {
const style = d.createElement("style");
d.head.append(style);
const { sheet } = style;
if (!sheet) return;
[
`.popup._badge-selection {
justify-content: start !important;
}`,
`.popup._badge-selection .-list-item {
max-height: unset !important;
min-width: 256px;
}`,
`.popup .js-badge-list-container {
justify-content: center;
height: unset !important;
}`,
].forEach(rule => sheet.insertRule(rule));
})(window, document);
Long answer
As the badge container can grow indefinitely, at some point the wrapped description text (which also has padding-top and padding-bottom of 16px and 12px respectively) starts to overflow the container. Here is an extract from the ruleset:
.popup._badge-selection .-list-item {
/* ...other rules */
max-height: 128px;
}
Simply removing the rule would've solved the problem if not for the inline height: 75% set on the parent container, which makes an unrestrained badge container stretch the full height of the parent leading to:
One could add the ai-start class to prevent the flex item from stretching, but this obviously messes up the tile layout of multiple badges:
Another difficulty is presented by the fact badge filtering also uses inline styles (display: none <-> display: block) to show/hide badges depending on the query and not the Stacks classes (d-none and d-block respectively).
Given the above, the most reasonable thing to do is to unset the height override, but this presents another challenge since the #popup-next-badge container has a flex__center helper class which centers flex items on both main and cross axis resulting in:
Fortunately, this is solved with the help of justify-content rule set to start (with !important as Stacks helper class also uses the rule) on the .popup._badge-selection container. Note that the inner js-badge-list-container needs another override back to center if you want the badges to be horizontally centered.
If you feel that it gets a bit too spacey when there are only one or two badges, a min-width rule on ._list-item class set to 256px or higher will help. In the end, you should get a result similar to this (for the ruleset summary see the short answer):
!important! and adding a ! for each additional level of importance :)
arc. However, if I search forare, the result is also two badges--but they display properly.Enthusiastbadge, switch to theAlltab and search again, and there'll be three badges.alland search forvis, I get two badges and they're displayed properly (one of the resulting badges is an earned badge).