nativescript-ui-feedback icon indicating copy to clipboard operation
nativescript-ui-feedback copied to clipboard

Broken on NS7 & Angular 10 & IOS with 14.2 devices

Open aaltotsky opened this issue 5 years ago • 5 comments

Code is working perfectly fine on IOS devices 14.1. People who upgrade to 14.2 are experiencing app crash with error

NativeScript encountered a fatal error: Uncaught TypeError: Cannot read property 'itemView' of undefined at push... /node_modules/nativescript-ui-autocomplete/ui-autocomplete.js.SuggestionViewCell.layoutSubviews( file: node_modules/nativescript-ui-autocomplete/ui-autocomplete.ios.js:59:0)

Here is my layout:

            <RadAutoCompleteTextView #autocompleteBrandsRef suggestMode="Suggest" displayMode="Plain" completionMode="Contains" layoutMode="Horizontal" (textChanged)="brandNameChanged($event)">
                <SuggestionView tkAutoCompleteSuggestionView suggestionViewHeight="150">
                    <ng-template tkSuggestionItemTemplate let-item="item">
                        <StackLayout orientation="vertical" padding="10">
                            <Label [text]="item.text"></Label>
                        </StackLayout>
                    </ng-template>
                </SuggestionView>
            </RadAutoCompleteTextView>

Please, provide the details below:

Tell us about the problem

The error occurred in this code: this.view.itemView

SuggestionViewCell.prototype.layoutSubviews = function () {
        _super.prototype.layoutSubviews.call(this);
        var itemViewDimensions = this.measureCell(this.view.itemView);
        var cellView = this.view.itemView;
        View.layoutChild(this.owner, cellView, 0, 0, itemViewDimensions.measuredWidth, itemViewDimensions.measuredHeight);
        var measuredHeight = Utils.layout.round(Utils.layout.toDeviceIndependentPixels(itemViewDimensions.measuredHeight));
        this.owner.suggestionView.ios.cellHeight = measuredHeight;
    };

Which platform(s) does your issue occur on?

I ran on MacOS Catalina 10.15.7 and Xcode 12.2 beta (https://developer.apple.com/support/xcode/)

My package.json

"dependencies": { "@angular-devkit/schematics": "^10.2.0", "@angular/animations": "10.2.1", "@angular/common": "10.2.0", "@angular/compiler": "10.2.1", "@angular/core": "10.2.0", "@angular/forms": "10.2.1", "@angular/http": "~8.0.0-beta.10", "@angular/platform-browser": "10.2.0", "@angular/platform-browser-dynamic": "10.2.0", "@angular/router": "10.2.0", "@nativescript/schematics": "10.1.0", "@nativescript/angular": "10.0.0", "@nativescript/core": "~7.0.0", "nativescript-theme-core": "2.0.24", "nativescript-ui-autocomplete": "7.0.2", "nativescript-ui-sidedrawer": "9.0.2", "reflect-metadata": "~0.1.13", "rxjs": "~6.5.0", "zone.js": "~0.9.1" }, "devDependencies": { "@angular/compiler-cli": "10.2.1", "@nativescript/android": "7.0.1", "@nativescript/ios": "7.0.4", "@nativescript/webpack": "~3.0.8", "@ngtools/webpack": "~10.2.0", "node-sass": "4.12.0", "typescript": "3.9.7" },

Runtime: IOS CLI: latest

aaltotsky avatar Nov 12 '20 02:11 aaltotsky

I updated package.json components to the latest, but I still have the same error.

 "dependencies": {
    "@angular-devkit/schematics": "^10.2.0",
    "@angular/animations": "10.2.3",
    "@angular/common": "10.2.3",
    "@angular/compiler": "10.2.3",
    "@angular/core": "10.2.3",
    "@angular/forms": "10.2.3",
    "@angular/http": "~8.0.0-beta.10",
    "@angular/platform-browser": "10.2.3",
    "@angular/platform-browser-dynamic": "10.2.3",
    "@angular/router": "10.2.3",
    "@nativescript/schematics": "10.1.0",
    "@nativescript/angular": "10.1.7",
    "@nativescript/core": "~7.0.13",
    "nativescript-theme-core": "2.0.24",
    "nativescript-ui-autocomplete": "7.0.2",
    "nativescript-ui-sidedrawer": "9.0.3",
    "reflect-metadata": "~0.1.13",
    "rxjs": "~6.6.3",
    "zone.js": "~0.11.3"
  },
  "devDependencies": {
    "@angular/compiler-cli": "10.2.3",
    "@nativescript/android": "7.0.1",
    "@nativescript/ios": "7.0.5",
    "@nativescript/webpack": "~3.0.8",
    "@ngtools/webpack": "~10.2.0",
    "node-sass": "4.12.0",
    "typescript": "3.9.7"

aaltotsky avatar Nov 12 '20 06:11 aaltotsky

I also create issue at https://github.com/NativeScript/NativeScript/issues/9031

aaltotsky avatar Nov 16 '20 22:11 aaltotsky

This issue seems to be important, we also have the same problem on iOS 14.2, and need a fix quite urgentely

Tronix117 avatar Nov 26 '20 17:11 Tronix117

+1

HazizKhan avatar Dec 04 '20 14:12 HazizKhan

+1 still have the same issue on iOS 14.2

Upd4ting avatar Feb 14 '21 07:02 Upd4ting