Skip to content

Commit 750af3f

Browse files
committed
bug fix Drawer
1 parent e206347 commit 750af3f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/interactableComponents/drawer/Swipeable.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ export default class Swipeable extends Component<PropType, StateType> {
315315
break;
316316
}
317317

318-
if (this.rowWidth && this.leftWidth && this.rightOffset) {
318+
const leftRender = this.props.renderLeftActions ? this.leftWidth : true;
319+
const rightRender = this.props.renderRightActions ? this.rightOffset : true;
320+
321+
if (this.rowWidth && leftRender && rightRender) {
319322
this.setState({
320323
rowWidth: this.rowWidth,
321324
leftWidth: this.leftWidth,

src/interactableComponents/drawer/newDrawer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class NewDrawer extends PureBaseComponent {
9393
this.animationOptions = {bounciness: props.bounciness || 5};
9494
this.rightActionsContainerStyle = this.getActionsContainerStyle(Constants.isRTL ? [props.leftItem] : props.rightItems);
9595
this.leftActionsContainerStyle = this.getActionsContainerStyle(Constants.isRTL ? props.rightItems : [props.leftItem]);
96-
this.leftRender = Constants.isRTL ? this.renderRightActions : this.renderLeftActions;
97-
this.rightRender = Constants.isRTL ? this.renderLeftActions : this.renderRightActions;
96+
this.leftRender = props.leftItem ? (Constants.isRTL ? this.renderRightActions : this.renderLeftActions) : undefined;
97+
this.rightRender = props.rightItems ? (Constants.isRTL ? this.renderLeftActions : this.renderRightActions) : undefined;
9898

9999
// TODO: deprecate when removing old drawer version
100100
// this.checkDeprecations(props);

0 commit comments

Comments
 (0)