Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Apr 1, 2025

Issues Fixed

Fixes #28722

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 1, 2025
@dotnet-policy-service
Copy link
Contributor

Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@kubaflo kubaflo added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Apr 1, 2025
@kubaflo kubaflo marked this pull request as ready for review April 1, 2025 23:32
Copilot AI review requested due to automatic review settings April 1, 2025 23:32
@kubaflo kubaflo requested a review from a team as a code owner April 1, 2025 23:32
@kubaflo kubaflo requested review from jfversluis and mattleibow April 1, 2025 23:32
Copy link
Contributor

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

This PR fixes the issue where the IsEnabled property in BackButtonBehavior does not work correctly on iOS. The changes include new test cases to exercise the behavior, an update to the IsEnabledCore setter in BackButtonBehavior, and a check in ShellSectionRenderer that respects the IsEnabled setting.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28722.cs Added a test to verify BackButtonBehavior.IsEnabled functionality
src/Controls/tests/TestCases.HostApp/Issues/Issue28722.cs Updated the host app to include a page testing BackButtonBehavior behavior
src/Controls/src/Core/Shell/BackButtonBehavior.cs Modified IsEnabledCore setter to combine the value with the current IsEnabled
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs Added a check to prevent navigation when BackButtonBehavior is disabled
Comments suppressed due to low confidence (1)

src/Controls/src/Core/Shell/BackButtonBehavior.cs:77

  • The new logic in the IsEnabledCore setter combines the assigned value with the current IsEnabled state, which may lead to unintended behavior if the public IsEnabled property is updated independently. Consider reviewing this logic to ensure it meets the intended behavior, or add a clarifying comment to prevent future confusion.
bool IsEnabledCore { set => SetValue(IsEnabledProperty, value && IsEnabled); }

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IsEnabled does not work in BackButtonBehavior

2 participants