Skip to content

Commit d217a05

Browse files
authored
Merge pull request #2049 from HarshMN2345/fix-PRO-1882-modal-focus-fix
2 parents f08bad0 + 1cf57da commit d217a05

File tree

23 files changed

+79
-69
lines changed

23 files changed

+79
-69
lines changed

src/lib/components/billing/validateCreditModal.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
placeholder="Promo code"
5959
id="code"
6060
label="Add promo code"
61+
autofocus
6162
bind:value={coupon} />
6263

6364
<svelte:fragment slot="footer">

src/lib/components/feedback/evaluation.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
style="padding-block: 0.13rem">
1111
{#each Array(11) as _, i}
1212
<li>
13-
<Tag size="m" selected={value === i} on:click={() => (value = i)}>
13+
<Tag
14+
size="m"
15+
selected={value === i}
16+
autofocus={i === 0}
17+
data-rating={i}
18+
on:click={() => (value = i)}>
1419
{i}
1520
</Tag>
1621
</li>

src/lib/components/feedback/feedbackGeneral.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<InputTextarea
77
required
88
id="feedback"
9+
autofocus
910
bind:value={$feedbackData.message}
1011
label="Tell us more about your experience"
1112
placeholder="Share your suggestions and feature requests..." />

src/lib/components/navbar.svelte

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
import { base } from '$app/paths';
5252
import { logout } from '$lib/helpers/logout';
5353
import { app } from '$lib/stores/app';
54-
import { isTabletViewport } from '$lib/stores/viewport';
54+
import { isTabletViewport, isSmallViewport } from '$lib/stores/viewport';
5555
import { isCloud } from '$lib/system.js';
5656
import { user } from '$lib/stores/user';
5757
import { Click, trackEvent } from '$lib/actions/analytics';
@@ -166,20 +166,22 @@
166166
>Upgrade</Button.Anchor>
167167
{/if}
168168

169-
<DropList show={$feedback.show} class="extended-width">
170-
<Button.Button
171-
type="button"
172-
variant="compact"
173-
on:click={() => {
174-
toggleFeedback();
175-
trackEvent(Click.FeedbackSubmitClick, { source: 'top_nav' });
176-
}}
177-
>Feedback
178-
</Button.Button>
179-
<svelte:fragment slot="other">
180-
<Feedback />
181-
</svelte:fragment>
182-
</DropList>
169+
{#if !$isSmallViewport}
170+
<DropList show={$feedback.show} class="extended-width">
171+
<Button.Button
172+
type="button"
173+
variant="compact"
174+
on:click={() => {
175+
toggleFeedback();
176+
trackEvent(Click.FeedbackSubmitClick, { source: 'top_nav' });
177+
}}
178+
>Feedback
179+
</Button.Button>
180+
<svelte:fragment slot="other">
181+
<Feedback />
182+
</svelte:fragment>
183+
</DropList>
184+
{/if}
183185
<DropList
184186
noArrow
185187
scrollable

src/lib/components/sidebar.svelte

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import MobileSupportModal from '$routes/(console)/wizard/support/mobileSupportModal.svelte';
3636
import MobileFeedbackModal from '$routes/(console)/wizard/feedback/mobileFeedbackModal.svelte';
3737
import { getSidebarState, updateSidebarState } from '$lib/helpers/sidebar';
38-
import { isTabletViewport } from '$lib/stores/viewport';
38+
import { isTabletViewport, isSmallViewport } from '$lib/stores/viewport';
3939
import { Click, trackEvent } from '$lib/actions/analytics';
4040
4141
import type { HTMLAttributes } from 'svelte/elements';
@@ -255,7 +255,7 @@
255255
</Tooltip>
256256
</div>
257257
</Layout.Stack>
258-
{:else}
258+
{:else if $isSmallViewport}
259259
<div class="action-buttons">
260260
<Layout.Stack direction="column" gap="s">
261261
<DropList show={$feedback.show} scrollable>
@@ -282,7 +282,6 @@
282282
trackEvent(Click.SupportOpenClick, { source: 'side_nav' });
283283
}}>
284284
<span>Support</span>
285-
286285
<svelte:fragment slot="other">
287286
<MobileSupportModal bind:show={$showSupportModal}
288287
></MobileSupportModal>
@@ -314,43 +313,33 @@
314313
</div>
315314
{/if}
316315

317-
{#if project}
318-
<div class="only-mobile">
319-
<div class="action-buttons">
320-
<Layout.Stack direction="column" gap="s">
321-
<DropList show={$feedback.show} scrollable>
322-
<Button.Button
323-
variant="secondary"
324-
size="s"
325-
on:click={() => {
326-
toggleFeedback();
327-
trackEvent('click_menu_feedback', { source: 'side_nav' });
328-
}}
329-
><span>Feedback</span>
330-
</Button.Button>
331-
<svelte:fragment slot="other">
332-
<MobileFeedbackModal />
333-
</svelte:fragment>
334-
</DropList>
335-
336-
<DropList show={$showSupportModal} scrollable>
337-
<Button.Button
338-
variant="secondary"
339-
size="s"
340-
on:click={() => {
341-
$showSupportModal = true;
342-
trackEvent(Click.SupportOpenClick, { source: 'side_nav' });
343-
}}>
344-
<span>Support</span>
345-
346-
<svelte:fragment slot="other">
347-
<MobileSupportModal bind:show={$showSupportModal}
348-
></MobileSupportModal>
349-
</svelte:fragment>
350-
</Button.Button>
351-
</DropList>
352-
</Layout.Stack>
353-
</div>
316+
{#if project && $isSmallViewport}
317+
<div class="action-buttons">
318+
<Layout.Stack direction="column" gap="s">
319+
<DropList show={$feedback.show} scrollable>
320+
<Button.Button
321+
variant="secondary"
322+
size="s"
323+
on:click={() => {
324+
toggleFeedback();
325+
trackEvent('click_menu_feedback', { source: 'side_nav' });
326+
}}
327+
><span>Feedback</span>
328+
</Button.Button>
329+
</DropList>
330+
331+
<DropList show={$showSupportModal} scrollable>
332+
<Button.Button
333+
variant="secondary"
334+
size="s"
335+
on:click={() => {
336+
$showSupportModal = true;
337+
trackEvent(Click.SupportOpenClick, { source: 'side_nav' });
338+
}}>
339+
<span>Support</span>
340+
</Button.Button>
341+
</DropList>
342+
</Layout.Stack>
354343
</div>
355344
{/if}
356345
</div>

src/lib/layout/createProject.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
label="Name"
3535
placeholder="Project name"
3636
required
37+
autofocus
3738
bind:value={projectName} />
3839
{#if !showCustomId}
3940
<div>

src/routes/(console)/create-organization/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@
186186
bind:value={name}
187187
label="Organization name"
188188
placeholder="Enter organization name"
189+
autofocus
189190
id="name"
190191
required />
191192
</Fieldset>

src/routes/(console)/onboarding/create-organization/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070

7171
<Input.Text
7272
required
73+
autofocus
7374
disabled={isLoading}
7475
label="Organization name"
7576
bind:value={organizationName}

src/routes/(console)/onboarding/create-project/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
on:submit={createProject}>
103103
<svelte:fragment slot="submit">
104104
<Layout.Stack direction="row" justifyContent="flex-end">
105-
<Button.Button autofocus type="submit" variant="primary" size="s">
105+
<Button.Button type="submit" variant="primary" size="s">
106106
Create
107107
</Button.Button>
108108
</Layout.Stack>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
id="email"
7171
label="Email"
7272
placeholder="Enter email"
73-
autofocus={true}
73+
autofocus
7474
bind:value={email} />
7575
<InputText id="member-name" label="Name" placeholder="Enter name" bind:value={name} />
7676
{#if isCloud}

0 commit comments

Comments
 (0)