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

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

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Aug 2, 2024

☑️ 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
Copy link
Contributor Author

ShGKme commented Aug 2, 2024

/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
Copy link
Contributor

@Antreesy Antreesy left a comment

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 st3iny and Pytal August 2, 2024 12:15
@susnux
Copy link
Contributor

susnux commented Aug 3, 2024

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
Copy link
Contributor Author

ShGKme commented Aug 3, 2024

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