Skip to content

Button:highlighted stops working after 2nd click #4740

Closed

Description

@dottodot

I have a button which is in a custom component with the following template, and when I navigate to a page and back, the :highlighted styles only work the first 2 times.

<Button [nsRouterLink]="[link]" [row]="btnRow" [col]="btnCol" [colSpan]="btnColSpan" [rowSpan]="btnRowSpan" class="dash-btn"
    [ngClass]="btnClass" #dashBtn>
        <FormattedString>
           <Span class="dash-btn-text" text="{{icon}}&#x000a;" fontFamily="icomoon" fontSize="36"></Span>
           <Span class="dash-btn-text" text="&#x000a;" fontSize="5"></Span>
           <Span class="dash-btn-text dash-btn-label" text="{{label}}"></Span>
        </FormattedString>
</Button>

and scss

.dash-btn {
  text-transform: uppercase;
  font-size: 13;
  font-family: $headingfont;
  font-weight: bold;
  .dash-btn-text {
    background-color: transparent;
    color: $darkblue;
  }
  &.dash-btn-grey {
    background-color: $lightgrey;
  }
}

.dash-btn:highlighted {
  background-color: $darkgrey;
  .dash-btn-text {
    color: white;
  }
}

tns v3.1.3

├── @angular/animations@4.2.6
├── @angular/common@4.2.6
├── @angular/compiler@4.2.6
├── @angular/core@4.2.6
├── @angular/forms@4.2.6
├── @angular/http@4.2.6
├── @angular/platform-browser@4.2.6
├── @angular/router@4.2.6
├── nativescript-angular@4.2.0
├── nativescript-dev-sass@1.3.0
├── nativescript-dev-typescript@0.5.0
├── nativescript-theme-core@1.0.4
├── reflect-metadata@0.1.10
├── rxjs@5.4.3
├── tns-core-modules@3.1.1
├── tslint@5.6.0
├── typescript@2.4.2
└── zone.js@0.8.16

Activity

  1. NickIliev commented on Aug 23, 2017

    @NickIliev
    Contributor

    @dottodot thank you for logging this issue -I can confirm that the described scenario is valid and the highlighted selector is not working after page navigation on iOS (works as expected on Android).

    Steps to reproduce:

    • use this application
    • navigate via the Button (the initial tap triggers the highlighted state)
    • navigate back to the Button page
    • tap again the button - the highlighted state is not triggered anymore on iOS
  2. dottodot commented on Aug 27, 2017

    @dottodot
    Author

    @NickIliev Is there any kind of work around I can do until it's fixed? Just I'm on a bit of a deadline and would prefer not to have to publish with this issue if at all possible.

  3. NickIliev commented on Aug 29, 2017

    @NickIliev
    Contributor

    Confirming this as a bug in NativeScript Core as well.
    Demo project demonstrating the issue with the TypeScript template can be found [here](https://github.com/NickIliev/NativeScript-Issues-2017/tree/master/NativeScript/issue_4740_tsc

    Once again the issue is reproducible only on iOS (works as expected on Android)

    @dottodot we are currently investigating this issue so stay tuned for possible workarounds or fixes (all will be posted in this thread).

  4. added this to the milestone on Aug 29, 2017
  5. removed their assignment
    on Aug 29, 2017
  6. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    and removed on Sep 7, 2017
  7. removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Oct 16, 2017
  8. lock commented on Aug 27, 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 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions