Skip to content

Commit

Permalink
Refactor #1917 - For CascadeSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 12, 2021
1 parent f5cdda6 commit 77c5238
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/cascadeselect/CascadeSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface CascadeSelectProps {
tabIndex?: number;
ariaLabelledBy?: string;
appendTo?: HTMLElement;
transitionOptions?: object;
onChange?(e: ChangeParams): void;
onGroupChange?(e: GroupChangeParams): void;
onBeforeShow?(): void;
Expand Down
6 changes: 4 additions & 2 deletions src/components/cascadeselect/CascadeSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { classNames } from '../utils/ClassNames';
import ObjectUtils from '../utils/ObjectUtils';
import DomHandler from '../utils/DomHandler';
import { CSSTransition } from "react-transition-group";
import { CSSTransition } from '../transition/CSSTransition';
import ConnectedOverlayScrollHandler from '../utils/ConnectedOverlayScrollHandler';
import { CascadeSelectSub } from "./CascadeSelectSub";
import OverlayEventBus from '../overlayeventbus/OverlayEventBus';
Expand Down Expand Up @@ -32,6 +32,7 @@ export class CascadeSelect extends Component {
tabIndex: null,
ariaLabelledBy: null,
appendTo: null,
transitionOptions: null,
onChange: null,
onGroupChange: null,
onBeforeShow: null,
Expand Down Expand Up @@ -60,6 +61,7 @@ export class CascadeSelect extends Component {
tabIndex: PropTypes.number,
ariaLabelledBy: PropTypes.string,
appendTo: PropTypes.any,
transitionOptions: PropTypes.object,
onChange: PropTypes.func,
onGroupChange: PropTypes.func,
onBeforeShow: PropTypes.func,
Expand Down Expand Up @@ -407,7 +409,7 @@ export class CascadeSelect extends Component {

renderOverlay() {
const overlay = (
<CSSTransition nodeRef={this.overlayRef} classNames="p-connected-overlay" in={this.state.overlayVisible} timeout={{ enter: 120, exit: 100 }}
<CSSTransition nodeRef={this.overlayRef} classNames="p-connected-overlay" in={this.state.overlayVisible} timeout={{ enter: 120, exit: 100 }} options={this.props.transitionOptions}
unmountOnExit onEnter={this.onOverlayEnter} onEntered={this.onOverlayEntered} onExit={this.onOverlayExit} onExited={this.onOverlayExited}>
<div ref={this.overlayRef} className="p-cascadeselect-panel p-component" onClick={this.onPanelClick}>
<div className="p-cascadeselect-items-wrapper">
Expand Down
6 changes: 6 additions & 0 deletions src/showcase/cascadeselect/CascadeSelectDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,12 @@ const countryOptionTemplate = (option) => {
<td>null</td>
<td>The template of items.</td>
</tr>
<tr>
<td>transitionOptions</td>
<td>object</td>
<td>null</td>
<td>The properties of <a href="https://reactcommunity.org/react-transition-group/css-transition" rel="noopener noreferrer" target="_blank">CSSTransition</a> can be customized, except for "nodeRef" and "in" properties.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 77c5238

Please sign in to comment.