primeng icon indicating copy to clipboard operation
primeng copied to clipboard

p-select disabled option doesn't show in selecteditem

Open bvx5009 opened this issue 1 year ago • 2 comments

Describe the bug

p-select component doesn't render the disabled option. currently it just shows a placeholder if its there, otherwise empty until new selection is made: https://stackblitz.com/edit/jq2wj7cc?file=src%2Fapp%2Fselect-template-demo.ts

it was working in primeng 19.0.0: https://stackblitz.com/edit/xyyn7bpm-yxgjz1cm?file=src%2Fapp%2Fselect-template-demo.html

Pull Request Link

No response

Reason for not contributing a PR

  • [x] Lack of time
  • [ ] Unsure how to implement the fix/feature
  • [ ] Difficulty understanding the codebase
  • [ ] Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/jq2wj7cc?file=src%2Fapp%2Fselect-template-demo.ts

Environment

{ "name": "primeng-select-template-demo", "description": "PrimeNG SelectTemplateDemo", "license": "MIT", "keywords": [], "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test" }, "dependencies": { "@angular/animations": "^20.0.4", "@angular/cdk": "^20.0.3", "@angular/cli": "^20.0.3", "@angular/common": "^20.0.4", "@angular/compiler": "^20.0.4", "@angular/core": "^20.0.4", "@angular/forms": "^20.0.4", "@angular/platform-browser": "^20.0.4", "@angular/platform-browser-dynamic": "^20.0.4", "@angular/router": "^20.0.4", "@primeuix/themes": "latest", "@types/jasmine": "4.3.1", "@types/node": "22.9.0", "chart.js": "4.4.2", "primeicons": "latest", "primeng": "20.1.1", "quill": "2.0.2", "rxjs": "~7.8.2", "tailwindcss": "^3", "tailwindcss-primeui": "latest", "tslib": "^2.5.0", "zone.js": "~0.15.0" }, "devDependencies": { "@angular-devkit/build-angular": "^20.0.3", "@angular/cli": "^20.0.3", "@angular/compiler-cli": "^20.0.3", "@angular/language-service": "^20.0.0", "@types/jasmine": "~4.3.1", "@types/node": "^22.9.0", "codelyzer": "^0.0.28", "jasmine-core": "~4.6.0", "karma": "~6.4.2", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.0.0", "ts-node": "~10.9.2", "typescript": "~5.8.3", "tailwindcss": "^3.4.10", "autoprefixer": "^10.4.20", "postcss": "^8.4.41" } }

Angular version

20.0.3

PrimeNG version

v20

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

use p-select have disabled options in the source assign selecteditem to an item that is disabled

Expected behavior

if the selected item also happens to be disabled, still show it as selected item with or without ng-template

bvx5009 avatar Sep 16 '25 18:09 bvx5009

I believe this may be a duplicate of #18157.

KeithGillette avatar Sep 16 '25 23:09 KeithGillette

yup and looks like another one exists: https://github.com/primefaces/primeng/issues/18807 ill do better searching next time

bvx5009 avatar Sep 17 '25 17:09 bvx5009