-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: submit on last field, keyboard dismiss + fix go to next field in…
… modals
- Loading branch information
1 parent
da2cbf4
commit 51fbf2f
Showing
14 changed files
with
246 additions
and
275 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,24 +1,7 @@ | ||
import * as React from 'react'; | ||
import { FormContext } from './FormContext'; | ||
import type { IndexerType, ReferencerType } from './types'; | ||
|
||
export default function Form({ | ||
children, | ||
referencer, | ||
indexer, | ||
}: { | ||
children: any; | ||
indexer: IndexerType; | ||
referencer: ReferencerType; | ||
}) { | ||
return ( | ||
<FormContext.Provider | ||
value={{ | ||
indexer, | ||
referencer, | ||
}} | ||
> | ||
{children} | ||
</FormContext.Provider> | ||
); | ||
const empty = {}; | ||
export default function Form({ children }: { children: any }) { | ||
return <FormContext.Provider value={empty}>{children}</FormContext.Provider>; | ||
} |
This file contains 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 |
---|---|---|
@@ -1,14 +1,6 @@ | ||
import * as React from 'react'; | ||
import type { IndexerType, ReferencerType } from './types'; | ||
// import { MutableRefObject } from 'react'; | ||
|
||
export type FormContextType = { | ||
indexer: IndexerType; | ||
referencer: ReferencerType; | ||
export type FormContextType = {}; | ||
const empty = {}; | ||
|
||
// refForKey: MutableRefObject<FormRefKeyMap>; | ||
}; | ||
|
||
export const FormContext = React.createContext<FormContextType | undefined>( | ||
undefined | ||
); | ||
export const FormContext = React.createContext<FormContextType>(empty); |
This file contains 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,2 @@ | ||
const hasVirtualKeyboard = true; | ||
export default hasVirtualKeyboard; |
This file contains 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,22 @@ | ||
const hasTouch = 'ontouchstart' in window; | ||
|
||
// const screenIsPortrait = window.matchMedia('(orientation: portrait)').matches; | ||
// return screenIsPortrait ? 'portrait' : 'landscape'; | ||
// let heightPerOrientation: Record<string, number> = { | ||
// [getOrientation()]: window.innerHeight, | ||
// }; | ||
// window.addEventListener('resize', () => { | ||
// const initialHeight = heightPerOrientation[getOrientation()]; | ||
// if (initialHeight) { | ||
// if (window.innerHeight < initialHeight) { | ||
// console.log('Virtual keyboard likely opened'); | ||
// } else { | ||
// console.log('Virtual keyboard likely closed'); | ||
// initialHeight = window.innerHeight; | ||
// } | ||
// } | ||
// }); | ||
|
||
const screenIsLarge = window.matchMedia('(min-width: 1000px)').matches; | ||
const hasVirtualKeyboard = hasTouch && !screenIsLarge; | ||
export default hasVirtualKeyboard; |
This file contains 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.