Skip to content
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

textTransform style does not work under Android with New Arch #39524

Closed
retrixe opened this issue Sep 18, 2023 · 1 comment
Closed

textTransform style does not work under Android with New Arch #39524

retrixe opened this issue Sep 18, 2023 · 1 comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Triage 🔍 Platform: Android Android applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@retrixe
Copy link

retrixe commented Sep 18, 2023

Description

The textTransform style property does not work correctly on Android with the New Architecture enabled, none of the possible values, i.e. capitalize, lowercase or uppercase, function.

As per #39524 (comment) it does work correctly on iOS, this is Android specific.

React Native Version

0.72.4

Output of npx react-native info

System:
OS: Linux 6.5 Fedora Linux 39 (Workstation Edition Prerelease)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-11320H @ 3.20GHz
Memory: 5.03 GB / 15.14 GB
Shell:
version: 5.2.15
path: /bin/bash
Binaries:
Node:
version: 20.6.1
path: /usr/local/bin/node
Yarn: Not Found
npm:
version: 9.8.1
path: /usr/local/bin/npm
Watchman:
version: 20221225.010033.0
path: /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels:
- "31"
- "33"
Build Tools:
- 30.0.3
- 31.0.0
- 33.0.0
System Images:
- android-33 | Google APIs Intel x86_64 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java:
version: 17.0.8
path: /usr/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: 0.72.4
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

Steps to reproduce

  1. Create a Text component e.g. <Text>hEllo!</Text>
  2. Set textTransform style on it, e.g. <Text> -> <Text style={{ textTransform: 'lowercase' }}> or uppercase or capitalize.
  3. Expect the text to become hello!, HELLO! or HEllo! for the 3 values respectively, but this only functions correctly on the Old Architecture, not New Architecture. (Side note: textTransform Capitalize Does Not Behave As it Does in CSS #34117 means capitalize has incorrect behaviour on Old Architecture as well.)

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

https://github.com/retrixe/react-native-texttransform-bug (simply enabled the new arch and put this source code inside App.tsx)

import React from 'react';
import { SafeAreaView, ScrollView, Text, View } from 'react-native';

function App(): JSX.Element {
  return (
    <SafeAreaView>
      <ScrollView contentInsetAdjustmentBehavior="automatic">
        <View>
          <Text style={{textTransform: 'uppercase'}}>uppercase</Text>
          <Text style={{textTransform: 'lowercase'}}>LOWERCASE</Text>
          <Text style={{textTransform: 'capitalize'}}>capitalize</Text>
        </View>
      </ScrollView>
    </SafeAreaView>
  );
}

export default App;
@retrixe retrixe added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Sep 18, 2023
@github-actions github-actions bot added Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications. and removed Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Sep 18, 2023
@cortinico cortinico added the Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. label Sep 19, 2023
@enzomanuelmangano
Copy link

Hi @retrixe I'm experiencing the same issue on Android and I'm not able to reproduce by running the project on iOS

lunaleaps pushed a commit that referenced this issue Nov 3, 2023
Summary:
Fixes: #39524

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix textTransform not working in new architecture

Pull Request resolved: #41223

Test Plan:
**Before:**
<img width="307" alt="image" src="https://github.com/facebook/react-native/assets/34857453/d44e6030-0a49-42c9-be44-cf7541583af0">

**After:**
<img width="307" alt="image" src="https://github.com/facebook/react-native/assets/34857453/fb717cec-72d3-41d7-8c48-4ec9a9ecb16b">

Reviewed By: javache

Differential Revision: D50773216

Pulled By: NickGerleman

fbshipit-source-id: 769bf67f2661ff4ff7b88121493bdd27564458d3
Othinn pushed a commit to Othinn/react-native that referenced this issue Jan 9, 2024
Summary:
Fixes: facebook#39524

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix textTransform not working in new architecture

Pull Request resolved: facebook#41223

Test Plan:
**Before:**
<img width="307" alt="image" src="https://github.com/facebook/react-native/assets/34857453/d44e6030-0a49-42c9-be44-cf7541583af0">

**After:**
<img width="307" alt="image" src="https://github.com/facebook/react-native/assets/34857453/fb717cec-72d3-41d7-8c48-4ec9a9ecb16b">

Reviewed By: javache

Differential Revision: D50773216

Pulled By: NickGerleman

fbshipit-source-id: 769bf67f2661ff4ff7b88121493bdd27564458d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Triage 🔍 Platform: Android Android applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants