Skip to content

Fix/ drawer RTL bug #1446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 11, 2021
Merged

Fix/ drawer RTL bug #1446

merged 2 commits into from
Aug 11, 2021

Conversation

lidord-wix
Copy link
Contributor

Description

Fix issue with swiping drawer in RTL mode when there are items only on one side
issue - WOAUILIB-1965

Changelog

Fix RTL bug in drawer

@lidord-wix lidord-wix changed the title fix RTL bug Fix/ drawer RTL bug Aug 4, 2021
@ethanshar ethanshar requested review from Inbal-Tish and removed request for ethanshar August 4, 2021 13:55
@ethanshar ethanshar assigned Inbal-Tish and unassigned ethanshar Aug 4, 2021
: undefined;
this.leftRender = Constants.isRTL
? props.rightItems && this.renderRightActions
: props.leftItem && this.renderLeftActions;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not check if leftItem exists in the renderLeftActions method? (and the same for the rightItems...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually doesn't work.. the value of this.leftRender should be undefined and not () => undefined if the items don't exist.
I can write the methods that way, but I'm not sure if it makes it more clear:

  private renderLeftActions = this.props.leftItem
    ? (progress: Animated.Value /* , dragX: Animated.Value */) => {
      const {leftItem} = this.props;
      const leftItems = leftItem ? [leftItem] : undefined;
      return this.renderActions(leftItems, progress /* , dragX */);
    }
    : undefined;

@ethanshar ethanshar added the Important for Next Release PR that must be included in the release version label Aug 11, 2021
@ethanshar ethanshar merged commit f245199 into master Aug 11, 2021
@lidord-wix lidord-wix deleted the fix/drawer_RTL_bug branch September 14, 2021 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Important for Next Release PR that must be included in the release version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants