File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -200,14 +200,17 @@ export class PasswordInputLabelComponent extends BaseIconButton implements After
200200 /**
201201 * Reference to the wrapper element.
202202 */
203- @ViewChild ( "wrapper" ) wrapper : ElementRef < HTMLDivElement > ;
203+ @ViewChild ( "wrapper" , { static : true } ) wrapper : ElementRef < HTMLDivElement > ;
204204
205205 /**
206206 * Binding for applying class to host element.
207207 */
208208 @HostBinding ( "class.cds--form-item" ) labelClass = true ;
209209 @HostBinding ( "class.cds--password-input-wrapper" ) passwordInputWrapper = true ;
210210 @HostBinding ( "class.cds--text-input-wrapper" ) textInputWrapper = true ;
211+ @HostBinding ( "class.cds--text-input-wrapper--readonly" ) get isReadonly ( ) {
212+ return this . wrapper ?. nativeElement . querySelector ( "input" ) ?. readOnly ;
213+ }
211214
212215 /**
213216 * Constructor for PasswordInputLabelComponent.
Original file line number Diff line number Diff line change 11/* tslint:disable variable-name */
22
3- import { moduleMetadata , Meta } from "@storybook/angular" ;
4- import { InputModule , PasswordInputLabelComponent } from "." ;
53import { FormsModule } from "@angular/forms" ;
4+ import { Meta , moduleMetadata } from "@storybook/angular" ;
5+ import { InputModule , PasswordInputLabelComponent } from "." ;
66
77export default {
88 title : "Components/Input/Password" ,
@@ -34,7 +34,8 @@ const Template = (args) => ({
3434 [disabled]="disabled"
3535 [theme]="theme"
3636 [placeholder]="placeholder"
37- [autocomplete]="autocomplete">
37+ [autocomplete]="autocomplete"
38+ [readonly]="readonly">
3839 </cds-password-label>
3940 `
4041} ) ;
@@ -50,7 +51,8 @@ Basic.args = {
5051 placeholder : "Placeholder" ,
5152 autocomplete : "on" ,
5253 theme : "dark" ,
53- size : "md"
54+ size : "md" ,
55+ readonly : false
5456} ;
5557Basic . argTypes = {
5658 autocomplete : {
You can’t perform that action at this time.
0 commit comments