Skip to content

feat(NcPasswordField): add as-text prop to remove autocomplete - #5896

Merged
ShGKme merged 1 commit into
masterfrom
feat/nc-pasword-field--as-text
Aug 3, 2024
Merged

feat(NcPasswordField): add as-text prop to remove autocomplete#5896
ShGKme merged 1 commit into
masterfrom
feat/nc-pasword-field--as-text

Conversation

@ShGKme

@ShGKme ShGKme commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

☑️ Resolves

  • Sometimes we need to show secret but editable value, for example, a secret token
  • To hide we should use password field
  • But it is not a password. Neither creating a new password, nor authentication. It should not be saved, generated or autocompleted.
  • The problem - browsers have save/generate prompts for password fields. This behavior cannot be disabled with autocomplete="off", browsers ignore it.

Proposal: add a new as-text prop that forces using type="text" and emulates password field view.

Note: -webkit-text-security is not a standard feature, but well supported.

🖼️ Screenshots

image

🚧 Tasks

  • Add as-text prop to force text type and prevent autocomplete and

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme added 3. to review Waiting for reviews feature: input-field Covering the InputField, TextField, ... labels Aug 2, 2024
@ShGKme ShGKme added this to the 8.16.0 milestone Aug 2, 2024
@ShGKme ShGKme self-assigned this Aug 2, 2024
@ShGKme ShGKme changed the title feat(NcPasswordField): allow to show as input[type=text] without auto… feat(NcPasswordField): add as-text prop to remove autocomplete Aug 2, 2024
@ShGKme

ShGKme commented Aug 2, 2024

Copy link
Copy Markdown
Contributor Author

/backport to next

@nickvergessen
nickvergessen removed their request for review August 2, 2024 09:19
@ShGKme ShGKme added the enhancement New feature or request label Aug 2, 2024

@Antreesy Antreesy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, looks good by the code changes and caniuse info

@ShGKme
ShGKme requested review from Pytal and st3iny August 2, 2024 12:15
@susnux

susnux commented Aug 3, 2024

Copy link
Copy Markdown
Contributor

image

I do not like this, but yes support seems to be good and I do not see any non overcomplex solution (e.g. hidden input and fake ui). Because other solutions like replacing the shown context with *** is not a solution as in form submit it would be the wrong value.

@ShGKme

ShGKme commented Aug 3, 2024

Copy link
Copy Markdown
Contributor Author

Yeah, I didn't find a better solution :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement New feature or request feature: input-field Covering the InputField, TextField, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants