Skip to content

Commit

Permalink
[EuiDatePicker] Add right padding to account for clear icon (#5095)
Browse files Browse the repository at this point in the history
* [EuiDatePicker] Add right padding to account for clear icon

- Should only appear when `onClear` is passed, and if a date is present (`selected`)

* Add changelog entry

* PR feedback

Co-authored-by: Caroline Horn <[email protected]>

Co-authored-by: Caroline Horn <[email protected]>
  • Loading branch information
Constance and cchaos authored Aug 26, 2021
1 parent 097238d commit e07da8b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Fixed default value of `EuiPagination`'s `activePage` to target first page ([#5053](https://github.com/elastic/eui/pull/5053))
- Fixed screen reader text from displaying in some `EuiDataGrid` cell popovers ([#5087](https://github.com/elastic/eui/pull/5087))
- Fixed `EuiDatePicker` year dropdown when configured with `minDate` and/or `maxDate` ([#5069](https://github.com/elastic/eui/pull/5069))
- Fixed `EuiDatePicker`'s clear icon overlaying date text ([#5095](https://github.com/elastic/eui/pull/5095))

**Theme: Amsterdam**

Expand Down
1 change: 1 addition & 0 deletions src/components/date_picker/date_picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export class EuiDatePicker extends Component<_EuiDatePickerProps> {
'euiFieldText--fullWidth': fullWidth,
'euiFieldText-isLoading': isLoading,
'euiFieldText--withIcon': !inline && showIcon,
'euiFieldText--isClearable': !inline && selected && onClear,
'euiFieldText-isInvalid': isInvalid,
},
className
Expand Down
8 changes: 8 additions & 0 deletions src/components/form/field_text/_field_text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@
.euiFieldText--withIcon.euiFieldText--compressed {
@include euiFormControlWithIcon($isIconOptional: false, $side: 'left', $compressed: true);
}

.euiFieldText--isClearable {
@include euiFormControlWithIcon($isIconOptional: false, $side: 'right', $compressed: false);
}

.euiFieldText--isClearable.euiFieldText--compressed {
@include euiFormControlWithIcon($isIconOptional: false, $side: 'right', $compressed: true);
}

0 comments on commit e07da8b

Please sign in to comment.