Primeng: Readonly support for Dropdown

Created on 8 Dec 2016  路  2Comments  路  Source: primefaces/primeng

I'm submitting a ... (check one with "x")

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

http://plnkr.co/edit/BMj7AUeODPqmjlLvd6UY

Current behavior
formControlName="ruleDomainTableData"
[style]="{'width':'330px'}" [filter]="true"
[(ngModel)]="selectedRuleDomainTableDataRowOption"
(onChange)="setDisplayValue()"
[readonly]="!inEditMode" >

generates a console error:
Can't bind to 'readOnly' since it isn't a known property of 'p-dropdown'.

  1. If 'p-dropdown' is an Angular component and it has 'readOnly' input, then verify that it is part of this module.


If you include the readonly attribute on a p-dropdown control, the error results.

Expected behavior

Once implemented, the readonly attribute, when set to true, would lock interaction with the control, similar to that in place for the pInputText and pInputTextarea controls.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:
Windows 10 using VSCode editor.

  • Angular version: 2.2.1

  • PrimeNG version: 1.0.1

  • Browser: [Chrome 54 | IE 11 ]

  • Language: [TypeScript 2.0.0]

  • Node (for AoT issues): node --version = 6.4.0

new feature

Most helpful comment

Hi,

Thank you for your response. As noted above, we are looking for locking of the p-dropdown similar to what is in place for the pInputText and pInputTextarea controls. Disabling in Chrome and IE places styling on the controls that make them very hard to read and is not overridable with css, where as readonly controls maintain the font styling established in the css.

All 2 comments

Hello! You can use [disabled] instead of [readonly] and it works fine (http://plnkr.co/edit/39QUFR)

Hi,

Thank you for your response. As noted above, we are looking for locking of the p-dropdown similar to what is in place for the pInputText and pInputTextarea controls. Disabling in Chrome and IE places styling on the controls that make them very hard to read and is not overridable with css, where as readonly controls maintain the font styling established in the css.

Was this page helpful?
0 / 5 - 0 ratings