Skip to content

Conversation

@RafaelKayumov
Copy link
Contributor

@RafaelKayumov RafaelKayumov commented Sep 24, 2025

WOOMOB-1371, WOOMOB-1387

Description

  • Fixes the issue where tapping on a search bar in country selected caused a pop-back navigation
  • Additionally fixes the issue where the NonEditableOrderBanner was stuck at landscape width and made the whole order editing UI remain of a landscape width.

The issue was likely caused by a difference in the view hierarchy rendering on iOS. It could not be reproduced on iOS 18. In OrderForm, the parent GeometryReader container and NonEditableOrderBanner(width: geometry.size.width) caused the view to re-render whenever the keyboard appeared.
As a result, when presenting the country selector and focusing the search bar, the keyboard triggered a re-render. This broke the active NavigationLink, causing the country selector to dismiss unexpectedly.

The main idea of the fix is:

  • applying the GeometryReader to the parent view in body and applying the with value to a preference:
.background(
    GeometryReader { geometryProxy in
        Color.clear
            .preference(key: WidthPreferenceKey.self, value: geometryProxy.size.width)
    }
)
  • Introducing the bannerWidth state var:
@State private var bannerWidth: CGFloat = 0
  • Listen for preference change:
.onPreferenceChange(WidthPreferenceKey.self) { newWidth in
    bannerWidth = newWidth
}
  • Applying the width state for NonEditableOrderBanner:
NonEditableOrderBanner(width: bannerWidth)

Note: The majority of changes in the diff are caused by removing the parent GeometryReader {}.

Steps to reproduce

  • Build and run from trunk or use latest beta / prod.
  • Run on iOS 26
  • Navigate to a product creation
  • Start with adding customer details from scratch
  • Input an address line, postal code just in case
  • Tap on country setting and select a country
  • Save
  • Back in order creation form select a product and apply
  • Go back to customer address creation
  • Open the country selector and wait for couple settings
  • Tap on search bar - the country selector will be auto closed.

Testing information

Tested on iPhone 17 simulator (iOS 26)

Broken navigation before fix

NavigationBroken.mov

Navigation after fix

NavigationFixed.mov

Broken banner before fix

NonEditableOrderBanner-Broken.mov

Banner after fix

NonEditableOrderBanner_Fixed.mov

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@RafaelKayumov RafaelKayumov added type: bug A confirmed bug. Bug labels Sep 24, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 24, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16171-328e4aa
Version23.3
Bundle IDcom.automattic.alpha.woocommerce
Commit328e4aa
Installation URL6kbc343t6nvv0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@RafaelKayumov RafaelKayumov added this to the 23.4 milestone Sep 24, 2025
@RafaelKayumov RafaelKayumov marked this pull request as ready for review September 24, 2025 16:10
@itsmeichigo itsmeichigo self-assigned this Sep 25, 2025
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

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

Tested with simulator iPhone 17 and confirmed that this fixes the issue. Good work! 🚢

@RafaelKayumov RafaelKayumov merged commit bf2777e into trunk Sep 25, 2025
16 checks passed
@RafaelKayumov RafaelKayumov deleted the WOOMOB-1371-fix-broken-navigation branch September 25, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug type: bug A confirmed bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants