Skip to content

GridLayout (tap) binding works in Android, partially in iOS  #1882

Open
@dan-sel-tx

Description

@dan-sel-tx

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.4.0
  • Android Runtime: 5.4.0
  • iOS Runtime: 5.4.2
  • NativeScript-Angular: 7.2.0
  • Angular:7.2.0

Describe the bug
Bind a Gridlayout, 2 columns, with the tap event, using ngFor:

<GridLayout row="2" rows="*,*,*"  >
        <GridLayout [row]="icon.mainRow"  columns="*,*" *ngFor="let icon of icons.myData">
            <GridLayout (tap)=doAction(icon.linkCommand) [col]="icon.colNumber" rows="auto,auto">
                <Image row="0" [src]="icon.Image"></Image>
                <Label row="1" [text]="icon.Text" class="text-center iconTitle"></Label>                              
            </GridLayout>
        </GridLayout>
    </GridLayout>

Note: the structure of the Grid is being built dynamically by passing in row and col for each new data item.

This works great on Android, with each (tap) event firing for each element.
However, in iOS, only the second column (col='1') fires on tap.
It does not matter where I place the (tap), on the image, the label, the same result.
Works on Android, only works for second column on iOS.

Here is the other interesting thing, all other elements are bound properly on both devices.
I get the Text and Image, as well as the correct column and row for each iteration of the data to the GridLayout on both devices.

Why only the second column, on iOS only, will fire the (tap), I am at a loss.

To Reproduce
Layout grid as above, bind some sample data to it, for rows, cols, and text, image, link.
Build for both platforms.

Expected behavior
All (tap) events should fire for both columns on both platforms.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions