Skip to content

Commit bd4a17d

Browse files
authored
Merge pull request #1825 from appwrite/fix-firefox-region-behaviour
Fix: regions jumping around on Firefox
2 parents 15bb019 + 9a5f936 commit bd4a17d

File tree

1 file changed

+9
-7
lines changed
  • src/routes/(console)/organization-[organization]/wizard

1 file changed

+9
-7
lines changed

src/routes/(console)/organization-[organization]/wizard/step2.svelte

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@
6262
}
6363
6464
$: notifications = prefs?.notifications ?? [];
65+
66+
const sortedRegions = $regions.regions.sort((regionA, regionB) => {
67+
if (regionA.disabled >= regionB.disabled) {
68+
return 1;
69+
}
70+
return -1;
71+
});
6572
</script>
6673

6774
<WizardStep>
@@ -73,18 +80,13 @@
7380
<ul
7481
class="grid-box u-margin-block-start-16"
7582
style="--p-grid-item-size:12em; --p-grid-item-size-small-screens:12rem; --grid-gap: 1rem;">
76-
{#each $regions.regions.sort((regionA, regionB) => {
77-
if (regionA.disabled >= regionB.disabled) {
78-
return 1;
79-
}
80-
return -1;
81-
}) as region, index (region.$id)}
83+
{#each sortedRegions as region, index (region.$id)}
8284
<li>
8385
<RegionCard
8486
name="region"
8587
bind:group={$createProject.region}
8688
value={region.$id}
87-
disabled={!region.available}
89+
disabled={!region.available || region.disabled}
8890
autofocus={index === 0}>
8991
<div
9092
class="u-flex u-flex-vertical u-gap-8 u-justify-main-center u-cross-center u-margin-inline-auto">

0 commit comments

Comments
 (0)