Skip to content

Commit

Permalink
fix(DatePicker): ensure icon is correct if label extends past input (#…
Browse files Browse the repository at this point in the history
…14919)

* fix(DatePicker): ensure icon is correct if label extends past input

* style(FluidDatePicker): adjust span width when fluid
  • Loading branch information
tw15egan authored Oct 18, 2023
1 parent a0cf45d commit 20c087b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,15 @@ const DatePickerInput = React.forwardRef(function DatePickerInput(
</Text>
)}
<div className={wrapperClasses}>
{input}
{isFluid && <DatePickerIcon datePickerType={datePickerType} />}
<DatePickerIcon
datePickerType={datePickerType}
invalid={invalid}
warn={warn}
/>
<span>
{input}
{isFluid && <DatePickerIcon datePickerType={datePickerType} />}
<DatePickerIcon
datePickerType={datePickerType}
invalid={invalid}
warn={warn}
/>
</span>
</div>
{invalid && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@
}

.#{$prefix}--date-picker-input__wrapper {
position: relative;
display: flex;
align-items: center;
}

.#{$prefix}--date-picker-input__wrapper span {
position: relative;
}

.#{$prefix}--date-picker.#{$prefix}--date-picker--simple
.#{$prefix}--date-picker__input,
.#{$prefix}--date-picker.#{$prefix}--date-picker--simple .#{$prefix}--label {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
white-space: nowrap;
}

.#{$prefix}--date-picker--fluid
.#{$prefix}--date-picker-input__wrapper
> span {
inline-size: 100%;
}

.#{$prefix}--date-picker--fluid
.#{$prefix}--date-picker-input__wrapper
.#{$prefix}--date-picker__input {
Expand Down

0 comments on commit 20c087b

Please sign in to comment.