web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
662 stars 170 forks source link

Unable to change input style or format inside date picker modal #327

Closed amiraabdelmalek closed 11 months ago

amiraabdelmalek commented 1 year ago

Current behaviour

I am trying to customize my date picker everything works fine but the input inside the modal is not changing neither for the format or for the styling.

Expected behaviour

I want to be able to change the input style and format inside the date modal

How to reproduce?

this is how i am trying to access the input props to be able to change the date format fyi i am using frensh as language : import { DatePickerInput, fr, registerTranslation, } from 'react-native-paper-dates';

registerTranslation('fr', fr);

<DatePickerInput ref={datePickerRef} locale="fr" label={ <Text style={{ backgroundColor: backgroundLabel ? backgroundLabel : background, }}> {label} } style={{position: 'relative'}} value={inputValue} onChange={d => { handleChange(d); if (d) { setShowDelete(true); } }} inputMode="start" mode={'outlined'} // style={{modal: {backgroundColor: 'red'}}} theme={{ colors: themeColors, roundness: 8, }} placeholder="JJ/MM/AAAA" inputProps={{ placeholder: 'JJ/MM/AAAA', format: 'JJ/MM/AAAA', formatPlaceholder: 'JJ/MM/AAAA', mode: 'outline', }} calendarIcon={() => ( <MaterialCommunityIcons name={'calendar'} size={25} color={inputValue ? text : placeholder} // style={{alignSelf: 'center'}} /> )} editIcon={() => ( <MaterialCommunityIcons name={'calendar'} size={25} color={inputValue ? text : placeholder} // style={{alignSelf: 'center'}} /> )} format="JJ/MM/AAAA" formatPlaceholder="JJ/MM/AAAA" withDateFormatInLabel={false} outlineColor={outline} selectionColor={disabled} activeOutlineColor={text} uppercase={false} startYear={minDate} endYear={maxDate} editable={editing} error={errorValue && touchedValue} hasError={errorValue && touchedValue} onBlur={onBlur} />

Preview

this is the outside input : everything works perfectly the styling and format : Capture d’écran 2023-09-05 092232 this is the input inside the date modale the styling is not applying to the input just the theming and format is DD/MM/YYYY instead of JJ/MM/AAAA : Capture d’écran 2023-09-05 092037

Your Environment

React Native CLI

software version
"react-native" "0.70.6",
react-native-paper "^4.12.4"
"react-native-paper-dates" "^0.18.12"
github-actions[bot] commented 1 year ago

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.

github-actions[bot] commented 12 months ago

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.