mirror of
https://github.com/portainer/portainer.git
synced 2025-08-09 07:45:22 +02:00
fix(cluster): faster submitting load times [EE-5524] (#10280)
* faster submitting load times * scroll to selected tz option --------- Co-authored-by: testa113 <testa113>
This commit is contained in:
parent
dfd415c62e
commit
dde4b95426
3 changed files with 21 additions and 4 deletions
|
@ -57,6 +57,12 @@ export function TimeWindowPickerInputGroup({
|
|||
});
|
||||
}
|
||||
|
||||
// find the option index for react-select to scroll to the current option
|
||||
const timeZoneOptionIndex = useMemo(
|
||||
() => timeZoneOptions.findIndex((option) => option.value === timeZone),
|
||||
[timeZone, timeZoneOptions]
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap items-center gap-x-5">
|
||||
<div className="flex items-center gap-x-5">
|
||||
|
@ -90,7 +96,7 @@ export function TimeWindowPickerInputGroup({
|
|||
</div>
|
||||
<Select<Option<string>>
|
||||
options={timeZoneOptions}
|
||||
value={{ value: timeZone, label: timeZone }}
|
||||
value={timeZoneOptions[timeZoneOptionIndex]}
|
||||
className="w-72 min-w-fit"
|
||||
onChange={(newTimeZone) => {
|
||||
if (!newTimeZone) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue