1
0
Fork 0
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:
Ali 2023-09-11 00:52:00 +02:00 committed by GitHub
parent dfd415c62e
commit dde4b95426
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View file

@ -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;