Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed the Amount Text to TextInput #6811

Merged
merged 6 commits into from
Dec 27, 2021

Conversation

akshayasalvi
Copy link
Contributor

@akshayasalvi akshayasalvi commented Dec 17, 2021

Details

  • Allow pasting of amount in IOUAmount field

Fixed Issues

$ #6285

Tests

  1. Checked by pasting numeric and decimal values
  2. Checked that alphabets shouldn't be allowed
  3. Background and foreground switching

QA Steps

  1. Copy a numeric value
  2. Go to FAB and click on Send money or Request money option
  3. Paste the amount and you should be able to paste the amount

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

mweb-amount-pasting

Desktop

iOS

ios-amount-pasting.mov

Android

android-amount-pasting

@akshayasalvi akshayasalvi requested a review from a team as a code owner December 17, 2021 16:44
@MelvinBot MelvinBot requested review from tgolen and removed request for a team December 17, 2021 16:44
@akshayasalvi
Copy link
Contributor Author

akshayasalvi commented Dec 17, 2021

@tgolen @parasharrajat I've found one issue with the Mobile Web. Even though I've added Keyboard.dismiss and showSoftInputOnFocus, I can see the keyboard showing up.

Screenshot 2021-12-17 at 10 12 42 PM

Checking at my end

@parasharrajat
Copy link
Member

Ops, I didn't notice that we have to handle M-Web as well.

I've found one issue with the Mobile Web. Even though I've added Keyboard.dismiss and showSoftInputOnFocus, I can see the keyboard showing up.

Basically, this does not work for the Web. They are native props.

@parasharrajat
Copy link
Member

inputmode="none" try this.

@akshayasalvi
Copy link
Contributor Author

@parasharrajat Thanks for the suggestion. This worked.

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Can you also fix the conflicts, please?

this.unsubscribeAppStateSubscription();
}

handleAppStateChange(nextAppState) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Methods need to be named for what they do rather than for what they handle. I suggest renaming this to dismissKeyboardWhenBackgrounded

@akshayasalvi
Copy link
Contributor Author

@tgolen PR updated

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Thanks!

@tgolen tgolen merged commit 7116b6e into Expensify:main Dec 27, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

if (!this.unsubscribeAppStateSubscription) {
return;
}
this.unsubscribeAppStateSubscription();
Copy link
Contributor

Choose a reason for hiding this comment

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

This function does not return a method to unsubscribe...

https://reactnative.dev/docs/appstate#addeventlistener

Copy link
Contributor

Choose a reason for hiding this comment

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

this.unsubscribeAppStateSubscription.remove()

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes, good catch. I am seeing some console errors for this. @akshayasalvi can you please fix this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi,
Okay sure. I'll do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

No worries, we've fixed it already. This was taken care of in #6909

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the help

@marcaaron marcaaron mentioned this pull request Dec 28, 2021
5 tasks
@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @tgolen in version: 1.1.23-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 failure ❌
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Jan 4, 2022

🚀 Deployed to production by @francoisl in version: 1.1.24-8 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

if (!nextAppState.match(/inactive|background/)) {
return;
}
Keyboard.dismiss();
Copy link
Contributor

Choose a reason for hiding this comment

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

👋 Coming from #26505

Keyboard.dismiss was added as a fix #6285 (comment) where in native, showSoftInputOnFocus does not work if the app is backgrounded, then foregrounded
This was causing #26505 on Desktop
We resolved this by moving this logic to a platform-specific file, so it's called only on native platforms (since this bug is present only on native)

Copy link
Contributor

Choose a reason for hiding this comment

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

I love that. Thank you for moving it to a platform-specific file!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants