-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add PlusMinus icon and allow negative values in MoneyRequestAmountInput #56092
base: main
Are you sure you want to change the base?
Add PlusMinus icon and allow negative values in MoneyRequestAmountInput #56092
Conversation
…n MoneyRequestAmountForm
…nd simplify state updates
… and related functions
…r improved transaction handling
…text in MoneyRequestAmountForm
… currency flipping and improve amount validation
…to use updated utility functions and improve code clarity
… getTransactionDetails function
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@ZhenjaHorbach 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] |
Android videos skipped for now - I have issues locally to build it |
I'm assuming this PR is just for the big number pad/amount display, and that we'll handle displaying the negative amount in the push rows and previews elsewhere, is that correct? |
@dannymcclain Yes. At this PR I've prepared only the edit / create expense modal update |
Awesome, thanks for the confirmation! The mobile positioning is looking great, but I wanted to check with @shawnborton about the positioning on desktop. I get why they're placed right above the button, but they feel a little low to me. 🤔 Also, @Expensify/design, do we want these buttons to have a min-width to make them a little more tappable on mobile? Or do y'all think they're ok as is? |
Cool—I do think we should keep the flip button on desktop, but I like your updated placement there.
Because of the way we're displaying the minus symbol (to the left of the currency) I'm actually not sure if you will be able to use the minus key 😬 because the minus isn't really part of the input. |
Totally fair, I say we keep the button then - but let's see what @dubielzyk-expensify thinks too! |
Definitely agree on the min-width and the updated placement for desktop 👍
Hmm. That's fair I guess, but wouldn't we just detect the |
Yeah, that was my initial thinking as well... might as well respect it since it's available to the user to press via the keyboard. |
Yep. And I'm in favor of removing the flip button itself on desktop then, though if you both like if for extra visibility I don't feel super strongly about that part specifically |
Ah that's a great point Jon! I hadn't thought of that. I still kinda like keeping the button on desktop though 🫣 but if you both feel strongly you DON'T want it, it's not something I'm going to lose sleep over. |
As far as I understand, we decided not to leave |
as far as I understand, we agreed before to have the flip only 🙂 |
But in case of removal of it for desktop, I have a question: Since we have "-" as a symbol and want to remove it on the desktop, what is the expected behavior to remove the minus sign? It wouldn't be possible to remove it with backspace or edit it directly |
Why not? I would think hitting the backspace enough times would just remove the |
Yeah that's one of the reasons I was in favor of keeping the flip button on desktop. Just having a hard time wrapping my mind around how it would work with just the keyboard input. @Expensify/design do you have ideas around the preferred behavior for adding and removing the |
I just commented above but I don't see why we couldn't just use the backspace to get rid of the minus sign, as if you were typing into a text box. |
@shawnborton We currently have the next structure -
Do you mean that the "-" sign should be removed only in case when we have 0 and press backspace one more time? |
Yes, that's exactly what I mean. |
And in the case of "-" press - we don't care where the cursor was, right? |
I feel like you should only be able to press |
Got it! Should we also support this on mobile devices with the keyboard? |
Mobile devices wouldn't use a native keyboard, they would use our custom big number pad. |
I meant the physical one. I recall we had some issues with them before. |
Hmm I am not following, mind restating? Mobile shouldn't run into this issue because it would be forced to use the big number pad with buttons. There's no way to freely enter a minus sign via a native keyboard on mobile. |
Explanation of Change
Fixed Issues
$ #53441
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
android-web-converted.webm
iOS: Native
ios-native-converted.mp4
iOS: mWeb Safari
ios-web-converted.mp4
MacOS: Chrome / Safari
desktop-web-converted.mov
MacOS: Desktop
desktop-native-converted.mov