Skip to content

Fix: Prevent Modal Dropdown Truncation on Mobile #2085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/components/columnSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
columns,
isCustomCollection = false,
allowNoColumns = false,
portal = false,
children
}: {
columns: Writable<Column[]>;
isCustomCollection?: boolean;
allowNoColumns?: boolean;
portal?: boolean;
children: Snippet<[toggle: () => void, selectedColumnsNumber: number]>;
} = $props();

Expand Down Expand Up @@ -91,7 +93,7 @@

<svelte:window on:resize={calcMaxHeight} />
{#if $columns?.length}
<Popover let:toggle placement="bottom-end" padding="none">
<Popover let:toggle placement="bottom-end" padding="none" {portal}>
{@render children(toggle, selectedColumnsNumber)}
<svelte:fragment slot="tooltip">
<div style:max-height={maxHeight} style:overflow="scroll" bind:this={containerRef}>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/viewSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import type { Column } from '$lib/helpers/types';
import { Icon, Button } from '@appwrite.io/pink-svelte';
import { IconViewBoards } from '@appwrite.io/pink-icons-svelte';
import { isSmallViewport } from '$lib/stores/viewport';
import ViewToggle from './viewToggle.svelte';
import ColumnSelector from './columnSelector.svelte';

Expand All @@ -16,7 +17,7 @@
</script>

{#if !hideColumns && view === View.Table}
<ColumnSelector {columns} {isCustomCollection} {allowNoColumns}>
<ColumnSelector {columns} {isCustomCollection} {allowNoColumns} portal={$isSmallViewport}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might not be needed unless the ViewSelector itself is not in a modal or dialog some other upper layered component. Please check and verify.

{#snippet children(toggle, selectedColumnsNumber)}
<Button.Button
size="s"
Expand Down
3 changes: 2 additions & 1 deletion src/lib/layout/displaySettingsModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import type { Column } from '$lib/helpers/types';
import { IconViewBoards } from '@appwrite.io/pink-icons-svelte';
import { Button, Icon, Layout, Typography } from '@appwrite.io/pink-svelte';
import { isSmallViewport } from '$lib/stores/viewport';
import type { Writable } from 'svelte/store';

let {
Expand Down Expand Up @@ -35,7 +36,7 @@
{#if !hideColumns && $columns?.length}
<Layout.Stack gap="xs">
<Typography.Text>Columns</Typography.Text>
<ColumnSelector {columns} {isCustomCollection}>
<ColumnSelector {columns} {isCustomCollection} portal={$isSmallViewport}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can just pass true here, already inside a modal which is rendered due to responsiveContainerHeader > $isSmallViewport > #snippet settingsButton.

{#snippet children(toggle, selectedColumnsNumber)}
<Button.Button
size="s"
Expand Down