-
Notifications
You must be signed in to change notification settings - Fork 3.7k
53182 submit button jump confirmation page #53529
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
Merged
techievivek
merged 20 commits into
Expensify:main
from
huult:53182-submit-button-jump-confirmation-page
Dec 25, 2024
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8250f05
prevent submit button from jumping when proceeding to the confirmatio…
huult 53a6a35
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult c0d30f7
Update dismiss keyboard for web
huult ca09e27
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult c6368a5
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult ff74004
Add keyboard dismiss for web
huult 0a6cd9e
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult c01e82c
Specify dismiss keyboard behavior for Android native and Safari on mo…
huult 94b8c83
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult cbfc0d2
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult ff4fb89
add listen dimention changes
huult babeb3f
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult a89ea97
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult 65345c4
Check visual viewport before setting maxHeight
huult 968a125
Use visual viewport to detect keyboard show/hide
huult 9917a1b
Remove unused break line
huult 2d002c6
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult 38f9e8c
Merge remote-tracking branch 'upstream/main' into 53182-submit-button…
huult c25b460
fix eslint
huult 6704403
Update return default customUnitRateID when report ID is undefined
huult File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import {Keyboard} from 'react-native'; | ||
|
|
||
| let isVisible = false; | ||
| const initialViewportHeight = window?.visualViewport?.height; | ||
|
|
||
| const handleResize = () => { | ||
| const currentHeight = window?.visualViewport?.height; | ||
|
|
||
| if (!currentHeight || !initialViewportHeight) { | ||
| return; | ||
| } | ||
|
|
||
| if (currentHeight < initialViewportHeight) { | ||
| isVisible = true; | ||
| return; | ||
| } | ||
|
|
||
| if (currentHeight === initialViewportHeight) { | ||
| isVisible = false; | ||
| } | ||
| }; | ||
|
|
||
| window.visualViewport?.addEventListener('resize', handleResize); | ||
|
|
||
| const dismiss = (): Promise<void> => { | ||
| return new Promise((resolve) => { | ||
| if (!isVisible) { | ||
| resolve(); | ||
| return; | ||
| } | ||
|
|
||
| const handleDismissResize = () => { | ||
| if (window.visualViewport?.height !== initialViewportHeight) { | ||
| return; | ||
| } | ||
|
|
||
| window.visualViewport?.removeEventListener('resize', handleDismissResize); | ||
| return resolve(); | ||
| }; | ||
|
|
||
| window.visualViewport?.addEventListener('resize', handleDismissResize); | ||
| Keyboard.dismiss(); | ||
| }); | ||
| }; | ||
|
|
||
| const utils = {dismiss}; | ||
|
|
||
| export default utils; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are we using this @huult? This a mock on react-native-web.