Skip to content

Commit

Permalink
fix(Select): bug of autoWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
潕量 committed Nov 21, 2018
1 parent 53b91f9 commit b80e4bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/input/base.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class Base extends React.Component {
* 原生type
*/
htmlType: PropTypes.string,
/**
* name
*/
name: PropTypes.string,
state: PropTypes.oneOf(['error', 'loading', 'success']),
locale: PropTypes.object,
};
Expand Down
4 changes: 2 additions & 2 deletions src/select/base.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default class Base extends React.Component {
'beforeOpen',
'beforeClose',
'afterClose',
'handleResize'
'handleResize',
]);
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export default class Base extends React.Component {
syncWidth() {
const width = dom.getStyle(this.selectDOM, 'width');

if (width && (this.width !== width)) {
if (this.props.autoWidth && width && (this.width !== width)) {
this.width = width;

if (this.popupRef) {
Expand Down

0 comments on commit b80e4bb

Please sign in to comment.