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

[EuiSuperDatePicker] & [EuiButtonIcon] A couple quick fixes #5060

Merged
merged 9 commits into from
Aug 23, 2021
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
- Fixed rerender state issues in `PaginationButton` inside `EuiPagination` ([#5048](https://github.com/elastic/eui/pull/5048))
- Fixed bug in `euiHeaderAffordForFixed` mixin that was not accounting for situations where `EuiDataGrid` was in full screen mode ([#5054](https://github.com/elastic/eui/pull/5054))
- Fixed `z-index` styles that were causing `EuiModal` and `EuiFlyout` components to appear behind `EuiDataGrid` when in full screen mode ([#5054](https://github.com/elastic/eui/pull/5054))
- Fixed styles of `EuiButtonIcon` when passing `disabled` prop ([#5060](https://github.com/elastic/eui/pull/5060))

**Theme: Amsterdam**

- Updated styles for `EuiDatePicker` ([#5000](https://github.com/elastic/eui/pull/5000))
- Fixed styles for `EuiSuperDatePicker` ([#5060](https://github.com/elastic/eui/pull/5060))

## [`37.3.0`](https://github.com/elastic/eui/tree/v37.3.0)

Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/button/button_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default () => (
<EuiButtonIcon
iconType="arrowRight"
display="fill"
isDisabled
disabled
aria-label="Next"
/>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ exports[`EuiInMemoryTable behavior pagination 1`] = `
>
<button
aria-label="Next page"
className="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
className="euiButtonIcon euiButtonIcon-isDisabled euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
data-test-subj="pagination-button-next"
disabled={true}
onClick={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,22 @@ exports[`EuiButtonIcon props isDisabled is rendered 1`] = `
</button>
`;

exports[`EuiButtonIcon props isDisabled or disabled is rendered 1`] = `
<button
aria-label="button"
class="euiButtonIcon euiButtonIcon-isDisabled euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall"
disabled=""
type="button"
>
<span
aria-hidden="true"
class="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="user"
/>
</button>
`;

exports[`EuiButtonIcon props isDisabled renders a button even when href is defined 1`] = `
<button
aria-label="button"
Expand Down
8 changes: 8 additions & 0 deletions src/components/button/button_icon/button_icon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ describe('EuiButtonIcon', () => {
expect(component).toMatchSnapshot();
});

it('or disabled is rendered', () => {
const component = render(
<EuiButtonIcon iconType="user" aria-label="button" disabled />
);

expect(component).toMatchSnapshot();
});

it('renders a button even when href is defined', () => {
const component = render(
<EuiButtonIcon
Expand Down
3 changes: 2 additions & 1 deletion src/components/button/button_icon/button_icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const EuiButtonIcon: FunctionComponent<Props> = ({
iconSize = 'm',
color = 'primary',
isDisabled: _isDisabled,
disabled,
href,
type = 'button',
display = 'empty',
Expand All @@ -147,7 +148,7 @@ export const EuiButtonIcon: FunctionComponent<Props> = ({
...rest
}) => {
const isHrefValid = !href || validateHref(href);
const isDisabled = _isDisabled || !isHrefValid;
const isDisabled = _isDisabled || disabled || !isHrefValid;

const ariaHidden = rest['aria-hidden'];
const isAriaHidden = ariaHidden === 'true' || ariaHidden === true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports[`EuiDataGrid pagination renders 1`] = `
</ul>
<button
aria-label="Next page"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon-isDisabled euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
data-test-subj="pagination-button-next"
disabled=""
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
padding: $euiSize;
}

@include euiBreakpoint('xs', 's') {
@include euiBreakpoint('xs') {
.euiDatePopoverContent {
// Small screens drop the time selector
width: $euiDatePickerCalendarWidth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ exports[`EuiListGroupItem props extraAction can be disabled 1`] = `
</span>
</span>
<button
class="euiButtonIcon euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall euiListGroupItem__extraAction"
class="euiButtonIcon euiButtonIcon-isDisabled euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall euiListGroupItem__extraAction"
disabled=""
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

&.euiDatePicker--inline {
.euiFormControlLayout {
display: inline-block;
width: auto;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
text-decoration: underline;
}
}

@include euiBreakpoint('xs') {
margin-top: 0;
}
}

.react-datepicker__time,
Expand Down