Skip to content

Commit

Permalink
Merge pull request #118 from zapier/fix-keyboard-hover
Browse files Browse the repository at this point in the history
Send isHovering through renderTag
  • Loading branch information
jdeal authored Feb 23, 2019
2 parents fd8f757 + 1a0c75d commit 6d3bd9d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/helpers/choices-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ export default createReactClass({
}

return (
<li renderWith={this.renderWith('ChoicesItem')} className={cx(classes)}>
<li
renderWith={this.renderWith('ChoicesItem', {
isHovering: this.props.isHovering,
})}
className={cx(classes)}
>
{this.props.children}
</li>
);
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/css-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import cx from 'classnames';
const plugin = config => {
const { renderTag } = config;
const classes = {
ChoicesItem: ({ isHovering }) => ({
'Formatic_ChoicesItem-isHovering': isHovering,
}),
Field: ({ field }) => ({
'Formatic_Field-IsReadOnly': config.fieldIsReadOnly(field),
}),
Expand Down
3 changes: 2 additions & 1 deletion static/css/formatic.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@

.Formatic_PrettySelect_Choice:hover,
.Formatic_PrettyBoolean_Choice:hover,
.Formatic_PrettyText_Choice:hover {
.Formatic_PrettyText_Choice:hover,
.Formatic_ChoicesItem-isHovering {
background-color: #eef0f2;
}

Expand Down

0 comments on commit 6d3bd9d

Please sign in to comment.