Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

- Fixed bug in `EuiDataGrid` where a custom `className` was also being passed to the full screen button ([#5050](https://github.com/elastic/eui/pull/5050))
- Fixed rerender state issues in `PaginationButton` inside `EuiPagination` ([#5048](https://github.com/elastic/eui/pull/5048))
- 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
6 changes: 3 additions & 3 deletions src-docs/src/views/button/button_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ export default () => (
<EuiSpacer size="s" />
<EuiFlexGroup responsive={false} gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiButtonIcon iconType="arrowRight" isDisabled aria-label="Next" />
<EuiButtonIcon iconType="arrowRight" disabled aria-label="Next" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
display="base"
iconType="arrowRight"
isDisabled
disabled
aria-label="Next"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<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