fix: fixed-width host picker to prevent layout shift on long names

Replace minWidth/maxWidth with a fixed width:260 + flexShrink:0 so the
Autocomplete never resizes the header row. Chip labels also truncate
with ellipsis instead of wrapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
fuomag9
2026-02-27 13:32:59 +01:00
parent 1028322645
commit c8bc1f7500

View File

@@ -335,7 +335,7 @@ export default function AnalyticsClient() {
onChange={(_e, v) => setSelectedHosts(v)}
disableCloseOnSelect
limitTags={2}
sx={{ minWidth: 220, maxWidth: 380 }}
sx={{ width: 260, flexShrink: 0 }}
ListboxProps={{
// Prevent scroll from the dropdown list leaking to the page
style: { overscrollBehavior: 'contain' },
@@ -383,7 +383,7 @@ export default function AnalyticsClient() {
key={option}
label={option}
size="small"
sx={{ maxWidth: 140 }}
sx={{ maxWidth: 100, '& .MuiChip-label': { overflow: 'hidden', textOverflow: 'ellipsis' } }}
/>
));
}