-
Notifications
You must be signed in to change notification settings - Fork 14
feat(keyboard-full): add inputType prop for password masking #1048
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
Open
ludvigovrevik
wants to merge
4
commits into
develop
Choose a base branch
from
feat/keyboard-full-input-type
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
551afdb
docs(keyboard-full): design spec for inputType password masking
ludvigovrevik c618e24
feat(keyboard-full): add inputType prop for password masking
ludvigovrevik 7885964
test(keyboard-full): add Password story visual baseline
ludvigovrevik 6748ada
chore(keyboard-full): remove design spec from PR
ludvigovrevik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
docs/superpowers/specs/2026-07-07-keyboard-full-input-type-design.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Design: Password masking on `obc-keyboard-full` | ||
|
|
||
| Date: 2026-07-07 | ||
|
|
||
| ## Problem | ||
|
|
||
| A user asked to mask password input on the virtual keyboard. The internal | ||
| `obc-text-input-field` already supports masking (`type="password"` renders a | ||
| masked input plus a show/hide visibility toggle), but `obc-keyboard-full` never | ||
| forwards an input type to it — its embedded field always renders as plain text. | ||
|
|
||
| ## Goal | ||
|
|
||
| Let a consumer of `obc-keyboard-full` set the input type of the embedded | ||
| `obc-text-input-field`, so passwords render masked (and other input modes such | ||
| as email/tel/url become available for free). | ||
|
|
||
| ## API | ||
|
|
||
| Add one property to `obc-keyboard-full`: | ||
|
|
||
| ```ts | ||
| @property({type: String}) inputType: HTMLInputTypeAttribute = | ||
| HTMLInputTypeAttribute.Text; | ||
| ``` | ||
|
|
||
| - Named **`inputType`**, not `type`, because `type` is already taken by the | ||
| visual-variant property (`ObcKeyboardFullType`: `floating` / `flat`). The name | ||
| mirrors the existing `inputSize` property, which forwards to the input field's | ||
| `size`. | ||
| - Type is the existing `HTMLInputTypeAttribute` enum re-exported from | ||
| `text-input-field.ts` (`text` | `password` | `email` | `tel` | `url` | | ||
| `search` | `date` | `time`), defaulting to `text` (no behavior change for | ||
| existing consumers). | ||
|
|
||
| Usage: | ||
|
|
||
| ```html | ||
| <obc-keyboard-full inputType="password" parameterName="Password" showTopBar> | ||
| </obc-keyboard-full> | ||
| ``` | ||
|
|
||
| ## Implementation | ||
|
|
||
| All changes in `src/components/keyboard-full/`: | ||
|
|
||
| 1. Import `HTMLInputTypeAttribute` from `../text-input-field/text-input-field.js`. | ||
| 2. Declare the `inputType` property (default `Text`). | ||
| 3. Forward it in the template: `<obc-text-input-field .type=${this.inputType} …>`. | ||
| 4. JSDoc: document the property and add a password example to the class comment. | ||
| 5. Story: add a `Password` story so autodocs surface it and a snapshot exists. | ||
| 6. `npm run analyze` to update `custom-elements.json`. Framework wrappers are | ||
| regenerated by the normal build pipeline (never hand-edited). | ||
|
|
||
| ## What is intentionally unchanged | ||
|
|
||
| - **Key handling.** Keys still insert plain characters into `this.value`; only | ||
| the input field's *display* is masked. The `value-change` and `done-click` | ||
| events keep emitting the real string — the consumer needs the actual password. | ||
| - **Visibility toggle.** The show/hide eye button is rendered by | ||
| `obc-text-input-field` whenever `type="password"`; no keyboard-side work. | ||
|
|
||
| ## Testing | ||
|
|
||
| - New `Password` story renders masked → visual snapshot baseline (Linux, via the | ||
| CI-matching Docker image). | ||
| - `npm run analyze`, `npm run typecheck`, lint. | ||
|
|
||
| ## Scope | ||
|
|
||
| One property, one binding, one story, plus docs/manifest. No decomposition | ||
| needed. `obc-keyboard-full` is currently marked `@beta`, so the additive API | ||
| carries low compatibility risk. |
Binary file added
BIN
+25.9 KB
...baselines__/components/keyboard-full/keyboard-full.stories.ts/password-auto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@ludvigovrevik exclude the plan
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.
Removed in 6748ada.