Skip to content

Commit

Permalink
[Tooltip] Add support for horizontalPosition="right"
Browse files Browse the repository at this point in the history
Closes #6071
  • Loading branch information
LeeKevin authored and openersolutions committed Feb 7, 2017
1 parent cdab845 commit 380a732
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/RadioButton/RadioButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ class RadioButton extends Component {
React.cloneElement(uncheckedIcon, {
style: Object.assign(uncheckedStyles, uncheckedIcon.props.style),
}) :
<RadioButtonOff style={uncheckedStyles} />;
<RadioButtonOff style={uncheckedStyles} />;

const checkedElement = React.isValidElement(checkedIcon) ?
React.cloneElement(checkedIcon, {
style: Object.assign(checkedStyles, checkedIcon.props.style),
}) :
<RadioButtonOn style={checkedStyles} />;
<RadioButtonOn style={checkedStyles} />;

const mergedIconStyle = Object.assign(styles.icon, iconStyle);
const mergedLabelStyle = Object.assign(styles.label, labelStyle);
Expand Down
3 changes: 2 additions & 1 deletion src/internal/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function getStyles(props, context, state) {
opacity: 0,
right: horizontalPosition === 'left' ? 12 : null,
left: horizontalPosition === 'center' ?
(state.offsetWidth - 48) / 2 * -1 : null,
(state.offsetWidth - 48) / 2 * -1 :
horizontalPosition === 'right' ? 12 : null,
transition: `${transitions.easeOut('0ms', 'top', '450ms')}, ${
transitions.easeOut('450ms', 'transform', '0ms')}, ${
transitions.easeOut('450ms', 'opacity', '0ms')}`,
Expand Down

0 comments on commit 380a732

Please sign in to comment.