Skip to content

Commit

Permalink
fix select
Browse files Browse the repository at this point in the history
  • Loading branch information
intellild committed Apr 2, 2019
1 parent 44c2226 commit b055672
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 1 addition & 5 deletions packages/zent/src/popover/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class PopoverContent extends Component<
constructor(props) {
super(props);
this.state = {
position: null,
position: (invisiblePlacement as any)(props.prefix),
};

// 标记 content 的位置是否 ready
Expand Down Expand Up @@ -186,10 +186,6 @@ export default class PopoverContent extends Component<
} = this.props;
const { position } = this.state;

if (!position) {
return null;
}

const cls = cx(className, `${prefix}-popover`, id, position.toString());

return (
Expand Down
6 changes: 4 additions & 2 deletions packages/zent/src/portal/LayeredPortal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,14 @@ export class LayeredPortal extends Component<

render() {
// Render the portal content to container node or parent node
const { visible, withEscToClose, append } = this.props;
const { visible, withEscToClose, append, children } = this.props;
const { layer } = this.state;

return visible ? (
<>
<PurePortal ref={this.purePortalRef} append={append} selector={layer} />
<PurePortal ref={this.purePortalRef} append={append} selector={layer}>
{children}
</PurePortal>
{withEscToClose && (
<BodyEventHandler eventName="keyup" callback={this.onKeyDown} />
)}
Expand Down
5 changes: 1 addition & 4 deletions packages/zent/src/select/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Popup extends Component<IPopupProps, any> {
this.focused = false;
}

componentWillMount() {
componentDidMount() {
const { autoWidth, popover } = this.props;
if (autoWidth) {
this.setState({
Expand All @@ -71,9 +71,6 @@ class Popup extends Component<IPopupProps, any> {
},
});
}
}

componentDidMount() {
this.popup.addEventListener('mousewheel', this.handleScroll);
}

Expand Down

0 comments on commit b055672

Please sign in to comment.