Skip to content

Alert shows up wrong alignment in rtl layout in android #25948

@atlanteh

Description

@atlanteh

When using Alert.alert on android on an app that's forcing rtl & using rtl language the text alignment is wrong:

  1. Buttons should be aligned to the left
  2. Buttons should show from right to left

image

React Native version:
System:
OS: Windows 10
Binaries:
Node: 10.15.1
Yarn: yarn install v0.27.5
npm: 6.4.1
IDEs:
Android Studio: Version 3.0.0.0 AI-171.4443003
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.0

Steps To Reproduce

  1. See above example

Describe what you expected to happen:

  1. Buttons should be aligned to the left
  2. Buttons should show from right to left

Snack, code example, screenshot, or link to a repository:

I18nManager.forceRTL(true);
Alert.alert(
    'אימות',
    'האם הינך מעוניין/ת לצאת מהאפליקציה?',
    [
      {text: 'אישור', onPress: () => BackHandler.exitApp()},
      {text: 'ביטול', style: 'cancel'},
    ],
);

This is a duplicate of #24527 which is closed due to lack of info\inactivity

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: AlertBugPlatform: AndroidAndroid applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions