Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.57k stars 2.91k forks source link

Fix: Inbox - Blue frame on search icon after returning from finder with device back button #52943

Open nyomanjyotisa opened 10 hours ago

nyomanjyotisa commented 10 hours ago

Explanation of Change

Fixed Issues

$ https://github.com/Expensify/App/issues/52128 PROPOSAL: https://github.com/Expensify/App/issues/52128#issuecomment-2460365285

Tests

Same as QA Steps

Offline tests

Same as QA Steps

QA Steps

  1. On the inbox page, tap on the search icon on the top right corner
  2. Write anything on the search input
  3. Return to inbox using devices back button
  4. Verify that there is no blue frame on the search icon

PR Author Checklist

Screenshots/Videos

Android: Native https://github.com/user-attachments/assets/7e9fcbfc-1522-46bf-86fe-03ce685a337e
Android: mWeb Chrome https://github.com/user-attachments/assets/2fa5302e-88d0-42dc-9c7c-ec8d2f11fe04
iOS: Native https://github.com/user-attachments/assets/d4092720-e8ee-4b63-aea2-f5563d9ad427
iOS: mWeb Safari https://github.com/user-attachments/assets/1f36ac1d-983e-46c9-bfe8-0fa212d379ac
MacOS: Chrome / Safari https://github.com/user-attachments/assets/aba086fb-aec7-48c6-9845-ae8bf84ec0da
MacOS: Desktop https://github.com/user-attachments/assets/abb9fa97-1914-4ef9-affc-bb51d7946ce1
melvin-bot[bot] commented 3 hours ago

@rojiphil Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

nyomanjyotisa commented 3 hours ago

The reason I changed the onPress code is that the pressableRef?.current?.blur() call was being evaluated during the render phase. This happened because Session.checkIfActionIsAllowed() was executed immediately as part of the onPress. The change ensures that ref.current is accessed during runtime (when the button is pressed) instead of during render