-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add verticalSpacing prop #883
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to keep the name showCaret
, just so as to avoid the breaking change and get this out?
src/components/DateRangePicker.jsx
Outdated
@@ -338,6 +343,10 @@ class DateRangePicker extends React.Component { | |||
<CloseButton {...css(styles.DateRangePicker_closeButton_svg)} /> | |||
); | |||
|
|||
const inputHeight = parseInt(reactDates.font.input.lineHeight, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic is duplicated; can it be shared?
src/components/SingleDatePicker.jsx
Outdated
} = this.props; | ||
const { dayPickerContainerStyles, isDayPickerFocused, showKeyboardShortcuts } = this.state; | ||
|
||
const onOutsideClick = (!withFullScreenPortal && withPortal) ? this.onClearFocus : undefined; | ||
const closeIcon = customCloseIcon || (<CloseButton />); | ||
|
||
const inputHeight = parseInt(reactDates.font.input.lineHeight, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic is duplicated; can it be shared?
src/components/DateInput.jsx
Outdated
const withCaret = showCaret && focused; | ||
const withFang = showFang && focused; | ||
|
||
const inputHeight = parseInt(font.input.lineHeight, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic is triplicated, can it be shared?
src/components/DateInput.jsx
Outdated
@@ -196,6 +215,31 @@ class DateInput extends React.Component { | |||
aria-describedby={screenReaderMessage && screenReaderMessageId} | |||
/> | |||
|
|||
{withFang && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please surround multiline jsx with parens
09b71d7
to
8a558c9
Compare
@majapw I'm trying to use
Any pointers on what could be causing this issue? I looked at the code in |
This prop allows for greater customization of the space in between the picker and the inputs. Additionally, if that value is less than the height of the fang then we hide the fang. To accomplish this, I ended up revamping the fang so that it would use an svg instead of pseudo-selectors. The reasoning for this is that because I had to dynamically position the fang relative to the inputs (based on a prop), I had to leverage inline styles to do so. Unfortunately, the
::before
and::after
selectors don't allow for that.I also renamed caret to fang everywhere... which is like ¯\_(ツ)_/¯ but consistency?
This does not, however, solve #538... so maybe expanding the prop to allow for
em
values as well would be useful. However, this would maybe make the fang show/hide logic a bit more complicated (and have to be manual???). What are your thoughts? Maybe that belongs in a follow-up PR?to: @airbnb/webinfra @ljharb @noratarano @ethanresnick @gabergg @erin-doyle