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

Conversation

HarshMN2345
Copy link
Member

Fix: Prevent Modal Dropdown Truncation on Mobile

Problem

On mobile devices, dropdowns (such as the Columns dropdown in the Adjustments modal) were being truncated or clipped due to the modal’s content area having restricted overflow.

Solution

CSS-only fix:

  • Added a global CSS rule in src/lib/components/confirm.svelte
  • Allows dropdowns and overlays inside modals to overflow the modal content area
  • Ensures dropdowns are fully visible and scrollable on mobile devices

Reverted Changes

  • All previous JavaScript or logic-based changes related to dropdown max-height or mobile-specific handling have been reverted
  • This PR contains only the CSS fix mentioned above

Result

  • Dropdowns inside modals are now fully visible and usable across all devices, including mobile
  • No other logic or structural code was changed
  • This is a minimal and focused fix addressing the truncation issue

Before and After

Screenshot 2025-07-06 144534
Screenshot 2025-07-06 145447

…tent area, preventing them from being clipped or truncated.
@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Jul 6, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-07-09 06:42:30 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Jul 6, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-07-09 06:42:26 CET

@HarshMN2345 HarshMN2345 requested a review from Copilot July 6, 2025 09:34
@HarshMN2345 HarshMN2345 self-assigned this Jul 6, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

A CSS-only fix to allow dropdowns and overlays inside modals to overflow their container, preventing truncation on mobile devices.

  • Added a global CSS rule to make modal sections overflow visible
  • Reverted all previous JS/logic-based dropdown size handling
  • Ensures dropdowns are fully visible and scrollable across all devices

@HarshMN2345 HarshMN2345 requested a review from ItzNotABug July 8, 2025 06:42
Copy link
Member

@ItzNotABug ItzNotABug Jul 8, 2025

Choose a reason for hiding this comment

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

the component ColumnSelector uses Popover which supports a portal option, that should be a better solution. A prop to portal should be good for mobile modals because we don't need portal by default.

@HarshMN2345 HarshMN2345 requested a review from ItzNotABug July 9, 2025 06:39
@@ -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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants