@@ -16,6 +16,7 @@ import {
1616 Platform ,
1717} from "react-native" ;
1818import { useSafeAreaInsets } from "react-native-safe-area-context" ;
19+ import omit from "lodash.omit" ;
1920
2021import dateFormat from "dateformat" ;
2122import { withTheme } from "../../theming" ;
@@ -25,7 +26,12 @@ import DateTimePicker from "./DatePickerComponent";
2526
2627import type { Theme } from "../../styles/DefaultTheme" ;
2728import type { IconSlot } from "../../interfaces/Icon" ;
28- import { extractStyles } from "../../utilities" ;
29+ import {
30+ extractStyles ,
31+ marginStyleNames ,
32+ paddingStyleNames ,
33+ positionStyleNames ,
34+ } from "../../utilities" ;
2935
3036const AnimatedText = Animated . createAnimatedComponent ( Text ) ;
3137
@@ -124,7 +130,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
124130 width : number ;
125131 } > ( { measured : false , width : 0 } ) ;
126132
127- const { viewStyles , textStyles } = extractStyles ( style ) ;
133+ const { textStyles } = extractStyles ( style ) ;
128134
129135 const getValidDate = ( ) : Date => {
130136 if ( ! value ) {
@@ -384,21 +390,24 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
384390 type === "solid" ? { marginHorizontal : 12 } : { } ,
385391 ] ;
386392
387- // const render = (props) => <NativeTextInput {...props} />;
388-
389393 return (
390- < View style = { [ styles . container , style ] } >
394+ < >
391395 < Touchable disabled = { disabled } onPress = { toggleVisibility } >
392396 < View pointerEvents = "none" >
393- < View style = { [ styles . container , style ] } >
397+ < View
398+ style = { [
399+ styles . container ,
400+ omit ( style , [ ...paddingStyleNames , "backgroundColor" ] ) ,
401+ ] }
402+ >
394403 { leftIconName && leftIconMode === "outset" ? (
395404 < Icon { ...leftIconProps } style = { leftIconStyle } />
396405 ) : null }
397406 < View
398407 style = { [
399408 containerStyle ,
400409 style ? { height : style . height } : { } ,
401- viewStyles ,
410+ omit ( style , [ ... marginStyleNames , ... positionStyleNames ] ) ,
402411 ] }
403412 >
404413 { type === "underline" ? (
@@ -546,7 +555,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
546555 </ View >
547556 </ Portal >
548557 ) }
549- </ View >
558+ </ >
550559 ) ;
551560} ;
552561
0 commit comments