woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
312 stars 112 forks source link

[Tablet Orders] Presented sheets are dismissed on size class change, losing entered data. #12252

Closed joshheald closed 6 months ago

joshheald commented 8 months ago

Description

Changing the size of the view/device rotation during data entry; ensure state isn’t lost.

Generally state is lost from screens like the Custom Amount screen, as they get dismissed. Most problematic with customer details, the other screens are unlikely to have much data entered.

Found during M3 testing: pdfdoF-4GL-p2#comment-5929

Repro:

  1. Launch the app on an iPad
  2. Open the Orders tab and tap +
  3. Tap Add Customer Details or Add Note
  4. Enter some text
  5. Change the size class using a split view so that only one pane is shown
  6. Observe that the sheet is no longer shown
  7. Tap the button again
  8. Observe that your entered values are gone.

I think this is due to the presentation state being held on the OrderForm, which is recreated by the AdaptiveModalContainer on horizontal size class changes.

Moving that state to the EditableOrderViewModel might be enough to fix it, but I suspect we would also need to move the entered value state there as well.

dangermattic commented 8 months ago

Thanks for reporting! 👍