Skip to content

Commit

Permalink
Misc fixes (#473)
Browse files Browse the repository at this point in the history
* Don't propogate a null onClick on EuiPanels
* Use 1.1px for the default horizontal line height. This works around strange Chrome height calculations.
  • Loading branch information
pugnascotia authored Mar 13, 2018
1 parent 416a9d3 commit 229de17
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [`master`](https://github.com/elastic/eui/tree/master)

No public interface changes since `0.0.26`.
- Don't propagate a null `onClick` on EuiPanels ([#473](https://github.com/elastic/eui/pull/473))
- Use 1.1px for the `EuiHorizontalRule` height, in order to work around strange Chrome height calculations ([#473](https://github.com/elastic/eui/pull/473))

# [`0.0.26`](https://github.com/elastic/eui/tree/v0.0.26)

Expand Down
4 changes: 3 additions & 1 deletion src/components/horizontal_rule/_horizontal_rule.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.euiHorizontalRule {
border: none;
height: 1px;
// Sometimes Chrome "calculates" an element height of e.g. 0.990px, which it
// rounds down, thereby hiding the element.
height: 1.1px;
background-color: $euiBorderColor;

&.euiHorizontalRule--full {
Expand Down
18 changes: 12 additions & 6 deletions src/components/panel/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@ export const EuiPanel = ({

const PanelTag = onClick ? 'button' : 'div';

const props = {
ref: panelRef,
className: classes
}

// Avoid passing down this prop if it hasn't been supplied, in order to
// avoid noise in react-test-renderer snapshots.
if (onClick != null) {
props.onClick = onClick
}

return (
<PanelTag
onClick={onClick}
ref={panelRef}
className={classes}
{...rest}
>
<PanelTag {...props} {...rest}>
{children}
</PanelTag>
);
Expand Down

0 comments on commit 229de17

Please sign in to comment.