Skip to content
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

Backport 1.8.10: UI Masked inputs always look the same when value is hidden (#15025) #15034

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/15025.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: masked values no longer give away length or location of special characters
```
12 changes: 8 additions & 4 deletions ui/lib/core/addon/templates/components/masked-input.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<div class="masked-input {{if displayOnly "display-only"}} {{if allowCopy "allow-copy"}}"
data-test-masked-input data-test-field>
{{#if displayOnly}}
<pre class="masked-value display-only is-word-break {{unless showValue "masked-font"}}">{{unless showValue (truncate value 20) value}}</pre>
{{#if showValue}}
<pre class="masked-value display-only is-word-break">{{value}}</pre>
{{else}}
<pre class="masked-value display-only masked-font">***********</pre>
{{/if}}
{{else if inputField}}
<input
autocomplete="off"
Expand All @@ -13,7 +17,7 @@
data-test-input
/>
{{else}}
<textarea
<textarea
class="input masked-value {{unless showValue "masked-font"}}"
rows=1 wrap="off"
onkeydown={{action onKeyDown}}
Expand All @@ -23,7 +27,7 @@
value="target.value"
}}
value={{value}}
data-test-textarea
data-test-textarea
/>
{{/if}}
{{#if allowCopy}}
Expand All @@ -35,7 +39,7 @@
<Icon @glyph="copy-action" aria-hidden="Copy value" />
</CopyButton>
{{/if}}
<button
<button
onclick={{action "toggleMask"}}
type="button"
class="{{if (eq value "") "has-text-grey"}} masked-input-toggle button"
Expand Down
Loading