Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary White Spacing #163

Closed
samharvey44 opened this issue May 26, 2022 · 4 comments
Closed

Unnecessary White Spacing #163

samharvey44 opened this issue May 26, 2022 · 4 comments

Comments

@samharvey44
Copy link

samharvey44 commented May 26, 2022

The 'DatePickerInput' renders with HelperText, which causes empty white space to appear below the element. The 'visible' prop on HelperText does not determine whether it renders - it just either hides or shows it.

It should instead conditionally render the HelperText, so that it only mounts when necessary.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-paper-dates/src/Date/DatePickerInput.tsx b/node_modules/react-native-paper-dates/src/Date/DatePickerInput.tsx
index 541ab98..8fd3998 100644
--- a/node_modules/react-native-paper-dates/src/Date/DatePickerInput.tsx
+++ b/node_modules/react-native-paper-dates/src/Date/DatePickerInput.tsx
@@ -86,9 +86,12 @@ function DatePickerInput(
           />
         ) : null}
       </View>
-      <HelperText type="error" visible={!!error}>
-        {error}
-      </HelperText>
+
+      {!!error && (
+          <HelperText type="error">
+              {error}
+          </HelperText>
+      )}
 
       {withModal ? (
         <DatePickerModal

This issue body was partially generated by patch-package.

@CosminGRG
Copy link

I suppose this is what you are speaking about. The fix above doesn't seem to work for me
image

@samharvey44
Copy link
Author

samharvey44 commented Aug 21, 2022

I suppose this is what you are speaking about. The fix above doesn't seem to work for me
image

Hi there,

No, I think your issue is a different one.

Mine is related to a small amount of white space caused by a redundant helpertext component being rendered - not the amount of space you are showing.

@RichardLindhout
Copy link
Member

Ok, I've added this!

@hfllr
Copy link

hfllr commented Jan 25, 2024

I'm experiencing the exact same problem in the most recent version 0.21.7
No way to get rid of the white-spacing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants