Skip to content
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

ERROR TypeError: Cannot read property 'unit' of null #19

Open
devlfm opened this issue Jun 14, 2018 · 6 comments
Open

ERROR TypeError: Cannot read property 'unit' of null #19

devlfm opened this issue Jun 14, 2018 · 6 comments

Comments

@devlfm
Copy link

devlfm commented Jun 14, 2018

Hi,

I'm not able to use shadow when inside of a RadListView and ng-template. Always throw that error..

Any workaround?

Thanks

@bzaruk
Copy link

bzaruk commented Jun 15, 2018

+1

this is how my listview item looks

<ng-template tkTemplateKey="error" let-item="item.payload">
    <Stacklayout class="light-background" margin="15, 15, 20, 15" shadow="7">
        <Label class="slight-dark-color" margin="10" [text]="item.errorText"></Label>
    </Stacklayout>
</ng-template>
ERROR TypeError: Cannot read property 'payload' of undefined
JS: ERROR CONTEXT {
JS:   "view": {
JS:     "def": {
JS:       "nodeFlags": 50970627,
JS:       "rootNodeFlags": 3,
JS:       "nodeMatchedQueries": 0,
JS:       "flags": 0,
JS:       "nodes": [
JS:         {
JS:           "nodeIndex": 0,
JS:           "parent": null,
JS:           "renderParent": null,
JS:           "bindingIndex": 0,
JS:           "outputIndex": 0,
JS:           "checkIndex": -1,
JS:           "flags": 2,
JS:           "childFlags": 0,
JS:           "directChildFlags": 0,
JS:           "childMatchedQueries": 0,
JS:           "matchedQueries": {},
JS:           "matchedQueryIds": 0,
JS:           "references": {},
JS:           "ngContentIndex": null,
JS:           "childCount": 0,
JS:           "bindings": [],
JS:           "bindingFlags": 8,
JS:           "outputs": [],
JS:           "element": null,
JS:           "provider": null,
JS:           "text": {
JS:             "prefix": "\n            "
JS:           },
JS:           "query": null,
JS:           "ngContent": null
JS:         },
JS:         {
JS:           "nodeIndex": 1,
JS:           "parent": null,
JS:           "renderParent": null,
JS:           "bindingIndex": 0,
JS:           "outputI...

@bzaruk
Copy link

bzaruk commented Jun 27, 2018

Hi @TheOriginalJosh - Sorry to bother you but I wonder if you will have any idea how can we fix it?

@bzaruk
Copy link

bzaruk commented Jul 14, 2018

@devlfm -

I was able to workaround this issue with creating shadow to the element dynamically on itemLoading event.

Like this:
HTML:

<RadListView class="full-stretch" [items]="items" (itemLoading)="onItemLoading($event)">
</RadListView>

TS:

public onItemLoading(args: ListViewEventData) {
    Shadow.apply(args.view, { elevation: 7 });
}

@darkmantle
Copy link

@shabib3 How did you get access to Shadow ? What import did you use?

@darkmantle
Copy link

Figured that out, yet it doesn't work for me either. There is still no shadow in the ListItem - even when removing all styling as I had a background set before.

@vahidvdn
Copy link

I have the same issue with nativescript-fresco. I think this relates to RadlistView component. Any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants