Skip to content

Commit

Permalink
Merge pull request #916 from loadchange/hotfix_select_option_width
Browse files Browse the repository at this point in the history
Fix View props style
  • Loading branch information
hazel54 authored Jan 29, 2019
2 parents 74b7342 + cf93ed9 commit d7f0683
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import PropTypes from 'prop-types';

export default class View extends Component {
render() {
const mixed = { style: {} };
const classNames = [];
const { show = true, className = '', children } = this.props;
if (!show) mixed.style = { ...children.props.style, display: 'none' };
const mixed = { style: { ...children.props.style } };
if (!show) mixed.style.display = 'none';
if (children.props.className) classNames.push(children.props.className);
if (className) classNames.push(className);
mixed.className = classNames.join(' ');
Expand Down

0 comments on commit d7f0683

Please sign in to comment.