question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] StatusBarBehavior not reflected on back navigation

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the “Reporting a bug” section on Contributing file?

Current Behavior

When I navigate to a page that has a StatusBarBehavior and then back the previous colors are kept even if the page I returned to specifies a behavior with different colors.

Expected Behavior

The colors to change whenever a user navigates.

Steps To Reproduce

Click the Navigate button and then navigate back

Link to public reproduction project repository

https://github.com/pikausp/BackNavigationRepro

Environment

- .NET MAUI CommunityToolkit: 5.1.0
- OS: Android 13/iOS 16.4.1
- .NET MAUI: 7.0.86/7.0.100

Anything else?

No response

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bijingtoncommented, Jun 15, 2023

I agree with @pikausp. I expect the status bar to change when the page the behavior is attached to becomes visible. So effectively the OnAppearing logic

1reaction
pikauspcommented, Jun 14, 2023

I would say, the expected behavior is to not change the StatusBar color when we navigate back, it’s not something that should be attached to a Page, but a global configuration. I can’t remember an application that changes it on every navigation. If the dev wants that StatusBar color changes when navigating he should control that. We have static methods that can be called on the NavigateTo/NavigateFrom methods.

@pictos page A has a style, page B has a different style. Would you say it makes sense for the page A to have the style of Page B when returned to?

I could understand if you wanted a property on the behavior to activate this behavior, but I think it’s a reasonable request/expectation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Odd Navigation Bar/Status Bar behavior in Swift
Scenario 2: If the table was NOT scrolled to the very top when the row was selected, the navigation bar/status bar behavior is...
Read more >
StatusBarBehavior - .NET MAUI Community Toolkit
The StatusBarBehavior is a behavior allows you to control the statusbar's style.
Read more >
Sands of MAUI: Issue #73
Gerald starts off bringing in the .NET MAUI Community Toolkit NuGet package and adding StatusBarBehavior to a page—developers can customize the ...
Read more >
.NET MAUI Community Toolkit v1.3 Supports Gravatar (' ...
Another new construct, StatusBarBehavior , helps developers customize -- via code or in XAML -- the color and style of the status bar...
Read more >
Origami Community | Michael Tomkins made an example ...
Michael Tomkins made an example of a collapsible navigation bar and sticky header using the scrollaway and clip patch. https://www.dropbox.com/.../mta.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found