-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
web/elements: hidden secrets not propagating #19029
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
Changes from all commits
89dad07
914993a
f25a9c6
e0d5df8
7579090
3244276
5cc2c0f
831797b
36b10b4
e7527c5
9809b94
67aed3e
5b8d86b
67b3274
20b66f8
fe9e452
9cc440e
7bb6a3d
1dcf910
6d7fc94
dddde09
f6afb59
bd0e81b
be349e2
854427e
7d972ec
50d2f69
25eefb7
457b61c
e338bef
675e60b
2279768
ffbe8fb
19f25d5
811e794
75c61af
aa20df5
5fe344f
6838736
0055882
9251e60
cd78fc0
fa994ae
61dbc93
f63b3c2
9cf551b
9a6ca4f
8b95840
baa64bc
518e9e1
5da3493
136e59c
cddc13f
38c4701
e340268
8a389b4
f0e742c
79d5bc0
0457b59
f4393b7
d78e459
0ea5f10
6948146
a95d3ab
aa73014
0fc0783
b60bfad
4963dde
7347577
f55207b
7080053
7f353ac
951da48
d0daec4
442d42f
6a882f2
5603fe1
2c1fd70
08218dc
5b4a921
542a605
47ed22b
eaf9185
11f500c
91bbf0e
0845cc4
bc2a071
2c52a19
2c658e2
5c66e50
8585c64
63e1887
8509056
ac31137
be3f35c
9fbc760
2cd358d
d15e360
4f1126e
9a4c56e
1521ade
8d29ae4
1620155
2a43935
70ab5cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ import { ifDefined } from "lit/directives/if-defined.js"; | |
|
|
||
| @customElement("ak-secret-text-input") | ||
| export class AkSecretTextInput extends HorizontalLightComponent<string> { | ||
| @property({ type: String, reflect: true }) | ||
| @property({ type: String }) | ||
| public value = ""; | ||
|
|
||
| @property({ type: Boolean, reflect: true }) | ||
|
|
@@ -19,10 +19,20 @@ export class AkSecretTextInput extends HorizontalLightComponent<string> { | |
| @property({ type: String }) | ||
| public placeholder = ""; | ||
|
|
||
| @property({ type: Number, attribute: "maxlength" }) | ||
| public maxLength?: number; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Artifacts from comparison with |
||
|
|
||
| @property({ type: Number, attribute: "minlength" }) | ||
| public minLength?: number; | ||
|
|
||
| #onReveal() { | ||
| this.revealed = true; | ||
| } | ||
|
|
||
| #inputListener = (ev: InputEvent) => { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a known-working implementation inputListener, so I'm keeping it. |
||
| this.value = (ev.target as HTMLInputElement).value; | ||
| }; | ||
|
|
||
| #renderSecretInput() { | ||
| return html`<div class="pf-c-form__horizontal-group" @click=${() => this.#onReveal()}> | ||
| <input | ||
|
|
@@ -32,26 +42,32 @@ export class AkSecretTextInput extends HorizontalLightComponent<string> { | |
| data-form-ignore="true" | ||
| value="**************" | ||
| /> | ||
| <input type="text" value="${ifDefined(this.value)}" ?required=${this.required} hidden /> | ||
| <input | ||
| type="text" | ||
| value="${ifDefined(this.value)}" | ||
| ?required=${this.required} | ||
| name=${ifDefined(this.name)} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the actual fix. On |
||
| hidden | ||
| /> | ||
| <p class="pf-c-form__helper-text" aria-live="polite">${msg("Click to change value")}</p> | ||
| </div>`; | ||
| } | ||
|
|
||
| protected renderVisibleInput() { | ||
| const code = this.inputHint === "code"; | ||
| const setValue = (ev: InputEvent) => { | ||
| this.value = (ev.target as HTMLInputElement).value; | ||
| }; | ||
| const classes = { | ||
| "pf-c-form-control": true, | ||
| "pf-m-monospace": code, | ||
| }; | ||
|
|
||
| return html` <input | ||
| type="text" | ||
| @input=${setValue} | ||
| @input=${this.#inputListener} | ||
| name=${ifDefined(this.name)} | ||
| value=${ifDefined(this.value)} | ||
| class="${classMap(classes)}" | ||
| maxlength=${ifPresent(this.maxLength)} | ||
| minlength=${ifPresent(this.minLength)} | ||
| placeholder=${ifPresent(this.placeholder)} | ||
| autocomplete=${ifDefined(code ? "off" : undefined)} | ||
| spellcheck=${ifDefined(code ? "false" : undefined)} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Values should not be reflected.