Fix CustomSelect panel to left-align by default, right-align only when it would overflow the viewport

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Fraxle
2026-05-26 17:09:17 +01:00
co-authored by Claude Sonnet 4.6
parent 90789b5f47
commit d2952cddd2
2 changed files with 21 additions and 4 deletions
+8 -2
View File
@@ -475,8 +475,8 @@
.cs-panel {
position: absolute;
top: calc(100% + 4px);
right: 0; /* right edge flushes with button's right edge */
left: auto;
left: 0; /* left edge flushes with button's left edge by default */
right: auto;
z-index: 1000;
background: #fffcf2;
border: 1.5px solid #c9b08a;
@@ -487,6 +487,12 @@
overflow: hidden;
}
/* Flip panel to right-align when left-align would overflow the viewport */
.cs-panel.cs-panel--right {
left: auto;
right: 0;
}
/* Each option row */
.cs-option {
display: block;