Fix android datepicker height (#7804)
* fix datepicker height * fix suffixtext clipping
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import {Pressable, View} from 'react-native'
|
import {Pressable, View} from 'react-native'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {android, atoms as a, useTheme, web} from '#/alf'
|
import {atoms as a, native, useTheme, web} from '#/alf'
|
||||||
import * as TextField from '#/components/forms/TextField'
|
import * as TextField from '#/components/forms/TextField'
|
||||||
import {useInteractionState} from '#/components/hooks/useInteractionState'
|
import {useInteractionState} from '#/components/hooks/useInteractionState'
|
||||||
import {CalendarDays_Stroke2_Corner0_Rounded as CalendarDays} from '#/components/icons/CalendarDays'
|
import {CalendarDays_Stroke2_Corner0_Rounded as CalendarDays} from '#/components/icons/CalendarDays'
|
||||||
@@ -60,16 +60,16 @@ export function DateFieldButton({
|
|||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
style={[
|
style={[
|
||||||
{
|
{
|
||||||
paddingTop: 12,
|
|
||||||
paddingBottom: 12,
|
|
||||||
paddingLeft: 14,
|
paddingLeft: 14,
|
||||||
paddingRight: 14,
|
paddingRight: 14,
|
||||||
borderColor: 'transparent',
|
borderColor: 'transparent',
|
||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
},
|
},
|
||||||
android({
|
native({
|
||||||
minHeight: 57.5,
|
paddingTop: 10,
|
||||||
|
paddingBottom: 10,
|
||||||
}),
|
}),
|
||||||
|
web(a.py_md),
|
||||||
a.flex_row,
|
a.flex_row,
|
||||||
a.flex_1,
|
a.flex_1,
|
||||||
a.w_full,
|
a.w_full,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
android,
|
android,
|
||||||
applyFonts,
|
applyFonts,
|
||||||
atoms as a,
|
atoms as a,
|
||||||
|
ios,
|
||||||
TextStyleProp,
|
TextStyleProp,
|
||||||
useAlf,
|
useAlf,
|
||||||
useTheme,
|
useTheme,
|
||||||
@@ -189,13 +190,13 @@ export function createInput(Component: typeof TextInput) {
|
|||||||
a.px_xs,
|
a.px_xs,
|
||||||
{
|
{
|
||||||
// paddingVertical doesn't work w/multiline - esb
|
// paddingVertical doesn't work w/multiline - esb
|
||||||
paddingTop: 12,
|
|
||||||
paddingBottom: 13,
|
|
||||||
lineHeight: a.text_md.fontSize * 1.1875,
|
lineHeight: a.text_md.fontSize * 1.1875,
|
||||||
textAlignVertical: rest.multiline ? 'top' : undefined,
|
textAlignVertical: rest.multiline ? 'top' : undefined,
|
||||||
minHeight: rest.multiline ? 80 : undefined,
|
minHeight: rest.multiline ? 80 : undefined,
|
||||||
minWidth: 0,
|
minWidth: 0,
|
||||||
},
|
},
|
||||||
|
ios({paddingTop: 12, paddingBottom: 13}),
|
||||||
|
android(a.py_sm),
|
||||||
// fix for autofill styles covering border
|
// fix for autofill styles covering border
|
||||||
web({
|
web({
|
||||||
paddingTop: 10,
|
paddingTop: 10,
|
||||||
@@ -203,10 +204,6 @@ export function createInput(Component: typeof TextInput) {
|
|||||||
marginTop: 2,
|
marginTop: 2,
|
||||||
marginBottom: 2,
|
marginBottom: 2,
|
||||||
}),
|
}),
|
||||||
android({
|
|
||||||
paddingTop: 8,
|
|
||||||
paddingBottom: 8,
|
|
||||||
}),
|
|
||||||
style,
|
style,
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -355,17 +352,9 @@ export function SuffixText({
|
|||||||
a.pr_sm,
|
a.pr_sm,
|
||||||
a.text_md,
|
a.text_md,
|
||||||
t.atoms.text_contrast_medium,
|
t.atoms.text_contrast_medium,
|
||||||
{
|
a.pointer_events_none,
|
||||||
pointerEvents: 'none',
|
web([{marginTop: -2}, a.leading_snug]),
|
||||||
},
|
(ctx.hovered || ctx.focused) && {color: t.palette.contrast_800},
|
||||||
web({
|
|
||||||
marginTop: -2,
|
|
||||||
}),
|
|
||||||
ctx.hovered || ctx.focused
|
|
||||||
? {
|
|
||||||
color: t.palette.contrast_800,
|
|
||||||
}
|
|
||||||
: {},
|
|
||||||
style,
|
style,
|
||||||
]}>
|
]}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user