Skip to content

bug:ion-backdrop stays visible regardless of visible input #30742

Closed as duplicate

Description

@jdforsythe

Describe the Bug

ion-backdrop covers entire page and doesn't hide when [visible]="false"

Expected Behavior

backdrop should hide when visible is set to false

Steps to Reproduce

  1. Open the link for the stackblitz for the basic example of ion-backdrop: https://ionicframework.com/docs/api/backdrop
  2. change [visible]="true" to [visible]="false"
  3. backdrop does not disappear

Screenshots

Image Image

Operating System

MacOS

Browser

Chrome

Version

141.0.7390.66 (Official Build) (arm64)

Additional Information

No response

Activity

  1. changed the title [-]bug:[/-] [+]bug:ion-backdrop stays visible regardless of visible input[/+] on Oct 16, 2025
  2. thetaPC commented on Oct 17, 2026

    @thetaPC
    Contributor

    Thanks for the report, and sorry for the delay.

    Verified on 9.0.8. This is the same issue as #26953. The demo's CSS gives ion-backdrop its dark background from the page. visible="false" hides the backdrop by setting its background to transparent from inside the component's shadow root, and page CSS outranks shadow styles in the cascade, so the demo's background wins and the tint stays. Also note that visible only controls the tint: a backdrop with visible set to false still blocks clicks and taps by design, since overlays such as ion-modal rely on an invisible backdrop for showBackdrop together with backdropDismiss.

    Workarounds, both verified on 9.0.8:

    • To tint the backdrop only while it is visible, scope your CSS so it does not apply when visible is false:
    ion-backdrop:not(.backdrop-hide) {
      background: var(--ion-color-dark);
      opacity: 0.3;
    }
    • If you want the content behind it to be clickable, do not render the backdrop at all, for example with @if (showBackdrop) { <ion-backdrop></ion-backdrop> } in Angular.

    Closing this as a duplicate of #26953.

  3. ionitron-bot commented on Nov 16, 2026

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  4. locked and limited conversation to collaborators on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions