-
Notifications
You must be signed in to change notification settings - Fork 296
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
Vue Native doesn't strip (leading) whitespace in multi-line Text elements #164
Comments
With the same change in PR #165 made locally in VueNativeText/node_modules/vue-native-template-compiler/build.js I get this in my app now, using the same template as before (and after clearing the metro cache) : |
This issue is particularly important if you use an automatic formatter like Prettier on long text elements, i.e. it will wrap them with leading whitespace, which will show up in your app. |
@sanketsahusoft , @gauravprwl14 , @RishabhKarnad : any opinions on my pull request #165 ? |
Let us check this one. If all is well, we will merge it. |
Steps to reproduce:
vue-native init VueNativeText --no-crna
cd VueNativeText
react-native run-ios
Here are the contents of my App.vue :
Here is a screenshot of what appears in the app:
This doesn't happen in a React Native app; multiple spaces are stripped out and multiple lines are collapsed and wrapped.
You could argue that being able to control when a new line is started is useful (given that I have seen a number of answers for how to add newlines to React Native Text elements), however compatibility with React Native is probably better. At the very least, the leading whitespace should be removed.
The text was updated successfully, but these errors were encountered: