Open Mak-3 opened 6 days ago
You should open an issue against React Native so that it matches the browser behavior
React Native uses the NSString class from Objective-C, where this behavior is expected and intentional. Reference: capitalized
React Native implements the CSS property, so it should match how the web works.
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