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

Is there any way to vertically align the calendar icon for the DatePickerInput in "outlined" mode #298

Closed JPStrydom closed 1 year ago

JPStrydom commented 1 year ago

When rendering the DatePickerInput with mode="outlined", the calendar icon is not vertically aligned within the input box:

image

I can't seem to find a styling option to style the calendar icon - I've tried style, underlineStyle, outlineStyle, and contentStyle but not of these seemed to work.

Is there a way to vertically align of style the icon?

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.

JPStrydom commented 1 year ago

This is quite easy to replicate on the official DatePickerInput snack with the following code:

import React from "react";
import { View, Text } from "react-native";
import { DatePickerInput } from 'react-native-paper-dates';
import { SafeAreaProvider } from "react-native-safe-area-context";

export default function App() {
  const [inputDate, setInputDate] = React.useState(undefined)

  return (
    <SafeAreaProvider>
      <View style={{justifyContent: 'center', flex: 1, alignItems: 'center'}}>
        <DatePickerInput
          locale="en"
          label="Birthdate"
          value={inputDate}
          onChange={(d) => setInputDate(d)}
          inputMode="start"
          mode="outlined"
        />
      </View>
    </SafeAreaProvider>
  );
}

The will produce the following misaligned icon: image

Here is a reproduction example: react-native-paper-dates-input.zip

iM-GeeKy commented 1 year ago

@JPStrydom Thanks for opening this issue. If this issue is critical for you, please consider sending a pull request to fix it. If not, we will do our best to get it resolved when available.

SoyDiego commented 1 year ago

I think this issue can be closed, right? I can see in mode="outlined" perfectly centered.

image

JPStrydom commented 1 year ago

I think this issue can be closed, right? I can see in mode="outlined" perfectly centered.

image

Has there been an update to the library recently?

SoyDiego commented 1 year ago

I think this issue can be closed, right? I can see in mode="outlined" perfectly centered. image

Has there been an update to the library recently?

Sorry, my last screenshot was in Linux. Now I'm in Windows and I can see the problem. Very weird. I will try to solve it later.

image

Thanks!

SoyDiego commented 1 year ago

@JPStrydom I did a PR and I think solves the problem. If you can check it will be great: https://github.com/web-ridge/react-native-paper-dates/pull/315

JPStrydom commented 1 year ago

@JPStrydom I did a PR and I think solves the problem. If you can check it will be great: https://github.com/web-ridge/react-native-paper-dates/pull/315

The code looks good. Will let you know if it works once it's gone live 👍

SoyDiego commented 1 year ago

@JPStrydom I did a PR and I think solves the problem. If you can check it will be great: #315

The code looks good. Will let you know if it works once it's gone live 👍

The release is done and works perfectly on windows and Linux