Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

SegmentedBar's selectedTextColor property not working when set through CSS #11059

@jzgoda

Description

@jzgoda

Issue Description

When setting SegmentedBar's selectedTextColor using the selected-text-color CSS selector, the property is not being set

SegmentedBar {
  font-size: 14;
  font-weight: 600;
  color: #333333;
  background-color: #aaaaaa;
  selected-background-color: #000000;
  selected-text-color: #00ff00;  /* This is being ignored */
}
Image

Setting the property through XML works fine:

<GridLayout rows="auto">
  <SegmentedBar selectedTextColor="#00ff00">
    <SegmentedBarItem title="Item 1"></SegmentedBarItem>
    <SegmentedBarItem title="Item 2"></SegmentedBarItem>
    <SegmentedBarItem title="Item 3"></SegmentedBarItem>
  </SegmentedBar>
</GridLayout>
Image

This issue comes from a typo in the property setter/getter methods, where it's using selectedTabTextColor instead of selectedTextColor:

public get selectedTextColor(): Color {
	return this.style.selectedTabTextColor;
}
public set selectedTextColor(value: Color) {
	this.style.selectedTabTextColor = value;
}

Should be:

public get selectedTextColor(): Color {
	return this.style.selectedTextColor;
}
public set selectedTextColor(value: Color) {
	this.style.selectedTextColor = value;
}

I'm getting a PR ready for this fix.

Reproduction

No response

Relevant log output (if applicable)

Environment

OS: macOS 26.2
CPU: (10) arm64 Apple M2 Pro
Shell: /bin/zsh
node: 24.9.0
npm: 11.8.0
nativescript: 9.0.2

# android
java: 25.0.1
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 26.2/17C52
cocoapods: 1.16.2
python: 3.10.19
python3: 3.10.19
ruby: 3.3.10
platforms: 
  - DriverKit 25.2
  - iOS 26.2
  - macOS 26.2
  - tvOS 26.2
  - visionOS 26.2
  - watchOS 26.2

Dependencies

"dependencies": {
  "@angular/animations": "~20.2.0",
  "@angular/common": "~20.2.0",
  "@angular/compiler": "~20.2.0",
  "@angular/core": "~20.2.0",
  "@angular/forms": "~20.2.0",
  "@angular/platform-browser": "~20.2.0",
  "@angular/platform-browser-dynamic": "~20.2.0",
  "@angular/router": "~20.2.0",
  "@nativescript/angular": "^20.0.0",
  "@nativescript/core": "~9.0.0",
  "rxjs": "~7.8.0",
  "zone.js": "~0.15.0"
},
"devDependencies": {
  "@angular-devkit/build-angular": "~20.2.0",
  "@angular/compiler-cli": "~20.2.0",
  "@nativescript/ios": "9.0.3",
  "@nativescript/tailwind": "^2.1.0",
  "@nativescript/types": "~9.0.0",
  "@nativescript/webpack": "~5.0.25",
  "@ngtools/webpack": "~20.2.0",
  "tailwindcss": "~3.4.0",
  "typescript": "~5.8.0"
}

Please accept these terms

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-pending-triageReported bug, pending triage to confirm.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions