Skip to content

Multiple actionView items do not handle tap event correctly #1878

Closed

Description

@Daxito

Did you verify this is a real problem by searching [Stack Overflow]

Yes

Tell us about the problem

I have this ActionBar that contains two ActionItems, and each ActionItem contains an ActionView, seems like for Android only (iOS is ok) when I tap on one of two the ActionItems it always triggers same tap handler not matter where I tap

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 1.7.1
  • Cross-platform modules: 1.7.0
  • Runtime(s): Android 1.7.1

Please tell us how to recreate the issue in as much detail as possible.

  1. Please use the attached sample app and run it using Android
  2. Tap on the green label, you get message "Green"
  3. Tap on the red label, you get message "Green"!
  4. Run app using ios, tapping on the labels gives you the correct alert message, red for red, green for green

SampleApp.zip

Activity

  1. self-assigned this
    on Apr 1, 2016
  2. tsonevn commented on Apr 1, 2016

    @tsonevn
    Contributor

    Hi @Daxito,
    Thank you for reporting this issue.
    Unfortunately we confirm that this is global issue for Android projects.
    We will do everything possible to solve the problem.

    xml
    
    
        <Page.actionBar>
            <ActionBar>
                <ActionBar.actionItems>
                    <ActionItem tap="tapGreen">
                       <ActionItem.actionView>
                                <Label text="Green" color="green" />
                     </ActionItem.actionView>
                    </ActionItem>
                     <ActionItem tap="tapRed">
                       <ActionItem.actionView>
                                <Label text="Red" color="red" />
                        </ActionItem.actionView>
                    </ActionItem>
                </ActionBar.actionItems>
             </ActionBar>
        </Page.actionBar>
    
    
    
    JS
    
    exports.tapRed = function name(params) {
        alert("Red");
    }
    
    exports.tapGreen = function name(params) {
        alert("Green");
    }```
    
  3. Daxito commented on Apr 1, 2016

    @Daxito
    Author

    Ok, I have a workaround, if I only use one single action view item and put both labels there and assigning the tap to each label then it works for android, but it does not work for ios, I added a section for each platform for now.

  4. added a commit that references this issue on Apr 22, 2016
    ea9a9dc
  5. added a commit that references this issue on Apr 22, 2016
    c005055
  6. added this to the 2.0.0 milestone on Apr 22, 2016
  7. patuku-roy commented on Jun 7, 2016

    @patuku-roy

    @hamorphis is this problem solved? because I'm using NS 2.0.1 and this problem still exists.

  8. lock commented on Aug 30, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  9. locked and limited conversation to collaborators on Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions