You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of text-transform: capitalize in react-native-web does not match the behavior found in React Native. In React Native, this transformation converts all characters in a word to lowercase except for the first letter, which is capitalized. However, in react-native-web, the transformation only capitalizes the first letter of each word while leaving the remaining letters unchanged.
Expected behavior
Input: "hello WORLD from ReAcT nAtIvE"
Expected Output: "Hello World From React Native"
Current Output: "Hello WORLD From ReAcT nAtIvE"
Steps to reproduce
Set Up Environment:
Create a new React Native project using Expo or React Native CLI.
Set up a React Native Web environment (e.g., using Expo for web or a separate React project with react-native-web).
Create a Component:
In both the React Native and React Native Web projects, create a simple component that uses the Text component from both libraries.
Add Text with Capitalization:
Use the following example text in both projects:
<Textstyle={{textTransform: 'capitalize'}}>
hello WORLD from ReAcT nAtIvE
</Text>
Run Both Environments:
For React Native, run the app on a mobile simulator or device.
For React Native Web, run the app in a web browser.
Observe the Output:
Check the output in both environments:
React Native: The expected output should be "Hello World From React Native".
React Native Web: The output will likely be "Hello WORLD From ReAcT nAtIvE".
Compare Results:
Note the difference in behavior between the two platforms, highlighting the mismatch in capitalization.
Expected Result
React Native should properly capitalize the first letter of each word while converting the rest to lowercase.
React Native Web should only capitalize the first letter of each word without altering the case of the remaining letters.
Is there an existing issue for this?
Describe the issue
The current implementation of text-transform: capitalize in react-native-web does not match the behavior found in React Native. In React Native, this transformation converts all characters in a word to lowercase except for the first letter, which is capitalized. However, in react-native-web, the transformation only capitalizes the first letter of each word while leaving the remaining letters unchanged.
Expected behavior
Steps to reproduce
Set Up Environment:
react-native-web
).Create a Component:
Text
component from both libraries.Add Text with Capitalization:
Use the following example text in both projects:
Run Both Environments:
Observe the Output:
"Hello World From React Native"
."Hello WORLD From ReAcT nAtIvE"
.Compare Results:
Expected Result
Test case
https://codesandbox.io/s/sad-morning-79dhqp?file=/src/App.js
Additional comments
No response
The text was updated successfully, but these errors were encountered: