nativescript-rtl / ui

Add right-to-left support to the NativeScript framework
MIT License
24 stars 3 forks source link

isRtl = "false" crash on iOS 13 #8

Closed codeBasePlusPlus closed 4 years ago

codeBasePlusPlus commented 4 years ago

Packages: NativeScript: 6.4.0-2020-01-27-072920-14098 "tns-android": { "version": "6.3.1" }, "tns-ios": { "version": "6.3.0" } "@nativescript-rtl/ui": "^0.1.2", "@nativescript/theme": "2.3.0-2020-01-13-101337-01", "nativescript-vue": "~2.4.0", "tns-core-modules": "~6.3.0", " Device: iPhone X 13.3 (English)

Setup:

app.js

Vue.registerElement('RStackLayout', ()=> require('@nativescript-rtl/ui').StackLayout);

Home.vue

Case No.1:

<RStackLayout orientation="horizontal" horizontalAlignment="center" isRtl="true">
        <Label text="First" />
        <Label text="Second" />
        <Label text="Third" />
</RStackLayout>

Works 10/10, iOS and android and renders Third Second First

Case No.2:

<RStackLayout orientation="horizontal" horizontalAlignment="center" isRtl="false">
        <Label text="First" />
        <Label text="Second" />
        <Label text="Third" />
</RStackLayout>

Android, First Second Third as intended, iOS crashes with this:

*** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: _this.nativeViewProtected.setRotationY is not a function. (In '_this.nativeViewProtected.setRotationY(0)', '_this.nativeViewProtected.setRotationY' is undefined) at file:///node_modules/@nativescript-rtl/ui/stack-layout/stack-layout.ios.js:48:55 at invoke(file:///node_modules/@nativescript/core/timer/timer.js:54:53) at file:///node_modules/@nativescript/core/timer/timer.js:18:12 at UIApplicationMain([native code]) at run(file:///node_modules/@nativescript/core/application/application.js:312:26) at file:///node_modules/nativescript-vue/dist/index.js:14050:2 at file:///app/bundle.js:397:10 at ./app.js(file:///app/bundle.js:401:34) at __webpack_require__(file:///app/webpack/bootstrap:750:0) at checkDeferredModules(file:///app/webpack/bootstrap:43:0) at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0) at anonymous(file:///app/bundle.js:2:61) at evaluate([native code]) at moduleEvaluation([native code]) at [native code] at asyncFunctionResume([native code]) at [native code] at promiseReactionJob([native code]) ', reason: '(null)'

Case No.3:

Instead of using isRtl false, used a css class direction: ltr; Android: works as intended. Ios: does not crash but renders the Rstacklayout from RTL as if isRtl is true or direction was rtl.

Basically I can't set Rstacklayout to LTR on iOS without crashing.

Thanks,

xlmnxp commented 4 years ago

im working to fix it

xlmnxp commented 4 years ago

@codeBasePlusPlus fixed :smile: 📦 @nativescript-rtl/ui@0.1.3

arturikoX commented 4 years ago

Hi, I have the same problem with RGridLayout, I tried to make your changes but no luck...

xlmnxp commented 4 years ago

@arturikoX did you update the plugin to 0.1.3? if yes, can you share error logs and screenshot of your application?

arturikoX commented 4 years ago

@xlmnxp, Hi, Yes, I updated to 0.1.3, I currently don't have access to the mac but the error was in: https://github.com/nativescript-rtl/ui/blob/b217a573748368122b53bd68492b59c3df6749eb/grid-layout/grid-layout.ios.js#L48

( Same "_this.nativeViewProtected.setRotationY is not a function" thing... )

Thank you !

xlmnxp commented 4 years ago

@arturikoX fixed 📦 @nativescript-rtl/ui@0.1.4

xlmnxp commented 4 years ago

final fix 📦 @nativescript-rtl/ui@0.1.5