Skip to content

ActionItem with *ngIf throws an error when it's removed #942

Closed
@tsonevn

Description

@tsonevn

From @madakk on August 13, 2017 10:54

Looks like this is happening because ActionItems.removeItems calls _removeView directly: https://github.com/NativeScript/NativeScript/blob/12020bd8bbdb8d87f9100d713590d0db982b7661/tns-core-modules/ui/action-bar/action-bar-common.ts#L190

But the nativescript angular handler has already removed the view (due to the same *ngIf directive) causing the error.

I believe this can be fixed by simply checking that the item's parent is actually the actionBar before attempting to remove it.

Copied from original issue: NativeScript/NativeScript#4691

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions