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

nsRouterLinkActive doesn't add class active #145

Open
lano-vargas opened this issue Jan 17, 2025 · 0 comments
Open

nsRouterLinkActive doesn't add class active #145

lano-vargas opened this issue Jan 17, 2025 · 0 comments

Comments

@lano-vargas
Copy link

lano-vargas commented Jan 17, 2025

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):

Start new project by following the docs: https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-angular.
{
"name": "example-app",
"main": "./src/main.ts",
"version": "1.0.0",
"private": true,
"dependencies": {
"@angular/animations": "~19.0.0",
"@angular/common": "~19.0.0",
"@angular/compiler": "~19.0.0",
"@angular/core": "~19.0.0",
"@angular/forms": "~19.0.0",
"@angular/platform-browser": "~19.0.0",
"@angular/platform-browser-dynamic": "~19.0.0",
"@angular/router": "~19.0.0",
"@nativescript/angular": "^19.0.0",
"@nativescript/core": "~8.8.0",
"rxjs": "~7.8.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~19.0.0",
"@angular/compiler-cli": "~19.0.0",
"@nativescript/android": "8.8.6",
"@nativescript/tailwind": "^2.1.0",
"@nativescript/types": "~8.8.0",
"@nativescript/webpack": "~5.0.0",
"@ngtools/webpack": "~19.0.0",
"tailwindcss": "~3.4.0",
"typescript": "~5.6.0"
}
}

Describe the bug

run ns debug android and inspect element on devtools://devtools/bundled/inspector.html?ws=localhost:40000 no class active is added.

To Reproduce
After example-app create ns run android modify app.component.html

<GridLayout rows="*,60">
  <StackLayout row="0">
    <page-router-outlet></page-router-outlet>
  </StackLayout>
  <StackLayout row="1" orientation="horizontal">
      <Label text="Go to ID: 1" width="100%" backgroundColor="#43B3F4" textAlignment="center" [nsRouterLink]="['/item', '1']" nsRouterLinkActive="active"></Label>
  </StackLayout>
</GridLayout>

Add css rule in app.css:

@tailwind base;
@tailwind components;
@tailwind utilities;

.active {
    color: red;
}

Click on the buttom Go to ID: 1 at the bottom of the page button text doesn't change the colour
Expected behavior
Expected the button text to change colour to red.
Sample project

ns debug android. and inspect element devtools://devtools/bundled/inspector.html?ws=localhost:40000, no class active is added.

Additional context

No much more context just couple of updates to the example-app to replicate the issue.

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

1 participant