RadAutoCompleteTextView crashes when searching fast

plugins

#1

I use the autocomplete plugin on an Angular app in order to show results from google places, on the emulator it works fine and i see results, but when i type fast, it crashes with the error: Cannot read property '_subViews' of undefined.
On my real android device, galaxy s7, it crashes immediately when i type the first character.

My html:

<RadAutoCompleteTextView #autocmp
                            [items]="suggestionTokens"
                            maximumTokensCount="1"
                            suggestMode="Suggest"
                            displayMode="Plain"
                            completionMode="Contains"
                            class="search-location-field"
                            >
    <SuggestionView tkAutoCompleteSuggestionView>
        <ng-template tkSuggestionItemTemplate let-item="item">
            <GridLayout rows="*" columns="auto, *, auto" class="search-location-item-cont" (tap)="itemOnClick(item)">
                <Label row="0" col="0" text="&#xf002;" class="font-awesome search-location-item-row-label vert-cntr"></Label>
                <Label row="0" col="1" class="search-location-item-txt vert-cntr" [text]="item.text"></Label>
            </GridLayout>
        </ng-template>
    </SuggestionView>   
</RadAutoCompleteTextView>

The code:

    var that : any = this;

that.latitude = “51.5007292”;
that.longitude = “-0.1268141”;

    this.autocmp.autoCompleteTextView.loadSuggestionsAsync = function (text) {

        let encodedText = encodeURI(text);
        const locationSegment: string = that.latitude != null && that.longitude != null ?
                              ("&location=" + that.latitude + "," + that.longitude) : "";

        var promise = new Promise(function(resolve, reject) {
            http.request({
                url:
                "https://maps.googleapis.com/maps/api/place/autocomplete/json?" +
                "radius=50000" +
                locationSegment +
                "&language=he" +
                "&input=" + encodedText +
                "&key=YOUR_API_KEY"
                ,
                method: "GET"
            }).then(function (response) {
                console.log("Got a response from google places");

                var responseJSON = response.content.toJSON();

                var results = responseJSON.predictions;
                var items: Array<TokenModel> = new Array();
                for (var i = 0; i < results.length; i++) {
                    const f = new TokenModel(results[i].description, null);
                    items.push(f);
                }
                resolve(items);
            }, function (e) {
                reject();
            });
        });

        return promise;
    }

And the error message i get when hitting repeatedly on a key and then backspace:

An uncaught Exception occurred on “main” thread.
com.tns.NativeScriptException:
Calling js method onBindViewHolder failed

TypeError: Cannot read property ‘_subViews’ of undefined
File: "file:///data/data/org.nativescript.drive/files/app/tns_modules/nativescript-pro-ui/autocomplete/autocomplete.js, line: 171, column: 38

StackTrace:
Frame: function:‘AutoCompleteRemoteFetchAdapter.onBindViewHolder’, file:‘file:///data/data/org.nativescript.drive/files/app/tns_modules/nativescript-pro-ui/autocomplete/autocomplete.js’, line: 171, column: 39

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:957)
at com.tns.Runtime.callJSMethod(Runtime.java:941)
at com.tns.Runtime.callJSMethod(Runtime.java:933)
at com.tns.gen.com.telerik.widget.autocomplete.AutoCompleteAdapter_frnal_ts_helpers_l58_c38__AutoCompleteRemoteFetchAdapter.onBindViewHolder(com.telerik.widget.autocomplete.AutoCompleteAdapter.java)
at com.telerik.widget.list.ListViewWrapperAdapter.onBindViewHolder(ListViewWrapperAdapter.java:247)
at com.telerik.widget.list.ListViewWrapperAdapter.onBindViewHolder(ListViewWrapperAdapter.java:20)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6400)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6433)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5377)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5640)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5482)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5478)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2215)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1542)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1502)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3625)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3354)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3886)
at com.telerik.widget.list.RadListView.onLayout(RadListView.java:596)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


#2

I am also facing the same issue, when I type very fast or uses the back button very fast, app crashes.
I have tried to modify app.gradle as suggested in the github issue below but had no success.
Keep an eye in below issue, may be nativescript team fixes this soon.