Skip to content

bug: Opening card modal sets wrong color on statusbar if swipeToClose is set to true #26173

@torgnywalin

Description

@torgnywalin

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

Opening a card modal with swipeToClose: true will change StatusBar style to the style of the device.

Expected Behavior

I would expect that the behavior is the same regardless of what swipeToClose is set to.
And that if the modal is to change the statusbar it should be able to set it back to what is was set to before.

If keeping track is not possible I think there should be options for:

  • If the modal should be able to change the statusbar style at all (default to true for backward compability)
  • What style to return to (default to default)

Steps to Reproduce

To reproduce:

  • Open app on ios (ionic cap run ios)
  • The statusbar style is dark as set in App.vue (Statusbar is white on white)
  • Click the "Open card modal (with swipeToClose: false)" button
  • The statusbar is visible when modal is visible (No changes to statusbar style)
  • Click the "Open card modal (with swipeToClose: true)" button
  • The statusbar is visible when modal is visible (Now the statusbar style is changed to light)
  • Click the "Open card modal (with swipeToClose: false)" button
  • The statusbar is not visible when modal is visible (No changes to statusbar style)

Code Reproduction URL

https://github.com/torgnywalin/issueModalStatusBar

Ionic Info

[WARN] Error loading @capacitor/android package.json: Error: Cannot find module '@capacitor/android/package'

       Require stack:
       - /Users/torgnywalin/.nvm/versions/node/v16.13.1/lib/node_modules/@ionic/cli/lib/project/index.js
       - /Users/torgnywalin/.nvm/versions/node/v16.13.1/lib/node_modules/@ionic/cli/lib/index.js
       - /Users/torgnywalin/.nvm/versions/node/v16.13.1/lib/node_modules/@ionic/cli/index.js
       - /Users/torgnywalin/.nvm/versions/node/v16.13.1/lib/node_modules/@ionic/cli/bin/ionic

Ionic:

   Ionic CLI       : 6.20.3 (/Users/torgnywalin/.nvm/versions/node/v16.13.1/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 6.3.3

Capacitor:

   Capacitor CLI      : 4.4.0
   @capacitor/android : not installed
   @capacitor/core    : 4.4.0
   @capacitor/ios     : 4.4.0

Utility:

   cordova-res : not installed globally
   native-run  : 1.7.1

System:

   NodeJS : v16.13.1 (/Users/torgnywalin/.nvm/versions/node/v16.13.1/bin/node)
   npm    : 8.1.2
   OS     : macOS

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions