Skip to content

Commit

Permalink
Refactor #1891
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 12, 2021
1 parent db6ce1b commit 8c081f3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/multiselect/MultiSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ interface MultiSelectProps {
onChange?(e: ChangeParams): void;
onFocus?(event: React.FormEvent<HTMLInputElement>): void;
onBlur?(event: React.FormEvent<HTMLInputElement>): void;
onPanelShow?(): void;
onPanelHide?(): void;
onShow?(): void;
onHide?(): void;
}

export class MultiSelect extends React.Component<MultiSelectProps, any> { }
12 changes: 6 additions & 6 deletions src/components/multiselect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export class MultiSelect extends Component {
onChange: null,
onFocus: null,
onBlur: null,
onPanelShow: null,
onPanelHide: null
onShow: null,
onHide: null
};

static propTypes = {
Expand Down Expand Up @@ -114,8 +114,8 @@ export class MultiSelect extends Component {
onChange: PropTypes.func,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
onPanelShow: PropTypes.func,
onPanelHide: PropTypes.func
onShow: PropTypes.func,
onHide: PropTypes.func
};

constructor(props) {
Expand Down Expand Up @@ -334,13 +334,13 @@ export class MultiSelect extends Component {

show() {
this.setState({ overlayVisible: true }, () => {
this.props.onPanelShow && this.props.onPanelShow();
this.props.onShow && this.props.onShow();
});
}

hide() {
this.setState({ overlayVisible: false }, () => {
this.props.onPanelHide && this.props.onPanelHide();
this.props.onHide && this.props.onHide();
});
}

Expand Down
10 changes: 10 additions & 0 deletions src/showcase/multiselect/MultiSelectDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,16 @@ const groupedCities = [
<td>event: Browser event.</td>
<td>Callback to invoke when the element loses focus.</td>
</tr>
<tr>
<td>onShow</td>
<td>-</td>
<td>Callback to invoke when overlay panel becomes visible.</td>
</tr>
<tr>
<td>onHide</td>
<td>-</td>
<td>Callback to invoke when overlay panel becomes hidden.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 8c081f3

Please sign in to comment.