Skip to content

feat(core): add input type password with character masking#936

Closed
LeTamanoir wants to merge 8 commits intoanomalyco:mainfrom
LeTamanoir:feat/input-password-type
Closed

feat(core): add input type password with character masking#936
LeTamanoir wants to merge 8 commits intoanomalyco:mainfrom
LeTamanoir:feat/input-password-type

Conversation

@LeTamanoir
Copy link
Copy Markdown
Contributor

Summary

  • Add type prop ("text" | "password") and passwordChar prop to <input>
  • When type="password", all rendered characters are replaced with a mask character (default ) while the edit buffer retains the real value
  • Masking is applied at the Zig rendering layer via a new mask_codepoint field on EditorView, so cursor, selection, and navigation all work unchanged
  • Placeholder text is not masked

Add a mask_codepoint field to EditorView that replaces all rendered
characters with a single codepoint when set. The masking is applied
at the rendering layer (drawTextBufferInternal) so the edit buffer
is never modified. Placeholder text is excluded from masking.

Signed-off-by: LeTamanoir <martin.saldinger@kiln.fi>
Add a `type` prop ("text" | "password") and `passwordChar` prop to
InputRenderable. When type is "password", displayed characters are
replaced with the mask character (default "●") while the real value
stays intact in the edit buffer.

Signed-off-by: LeTamanoir <martin.saldinger@kiln.fi>
Signed-off-by: LeTamanoir <martin.saldinger@kiln.fi>
Signed-off-by: LeTamanoir <martin.saldinger@kiln.fi>
Warn and fall back to the default mask character when passwordChar
is not exactly one character, matching the parseBorderStyle pattern.

Signed-off-by: LeTamanoir <martin.saldinger@kiln.fi>
Signed-off-by: LeTamanoir <martin.saldinger@kiln.fi>
LeTamanoir and others added 2 commits April 8, 2026 16:39
Signed-off-by: LeTamanoir <martin.saldinger@kiln.fi>
@LeTamanoir LeTamanoir force-pushed the feat/input-password-type branch from 920a472 to f954606 Compare April 8, 2026 14:45
selfmadexyz

This comment was marked as low quality.

@simonklee
Copy link
Copy Markdown
Member

  1. I would have expected something like this to be implemented completely in the Input renderable and not native layers.
  2. Because of 1) you've introduced misc unicode bugs.

Closing since it's not the right approach.

@simonklee simonklee closed this Apr 8, 2026
@LeTamanoir
Copy link
Copy Markdown
Contributor Author

okay will try in the input renderable then 👍

@simonklee
Copy link
Copy Markdown
Member

okay will try in the input renderable then 👍

Awesome!

@LeTamanoir LeTamanoir deleted the feat/input-password-type branch April 9, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants