Skip to content

Changed the Amount Text to TextInput - #6811

Merged
tgolen merged 6 commits into
Expensify:mainfrom
akshayasalvi:allow-amount-pasting
Dec 27, 2021
Merged

tgolen merged 6 commits into
Expensify:mainfrom
akshayasalvi:allow-amount-pasting

Conversation

@akshayasalvi

@akshayasalvi akshayasalvi commented Dec 17, 2021 •

Copy link
Copy Markdown
Contributor

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

akshayasalvi commented Dec 17, 2021 •

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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
Copy Markdown
Member

inputmode="none" try this.

@akshayasalvi

Copy link
Copy Markdown
Contributor Author

@parasharrajat Thanks for the suggestion. This worked.

@tgolen tgolen left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread src/pages/iou/steps/IOUAmountPage.js Outdated
this.unsubscribeAppStateSubscription();
}

handleAppStateChange(nextAppState) {

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@tgolen PR updated

@tgolen tgolen left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
1 of 5 tasks
@OSBotify OSBotify mentioned this pull request Dec 29, 2021
44 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

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

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

@OSBotify

OSBotify commented Jan 4, 2022

Copy link
Copy Markdown
Contributor

🚀 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
Copy Markdown
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
Copy Markdown
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