feat: adds directive and property to disable password managers#1346
feat: adds directive and property to disable password managers#1346iOvergaard wants to merge 6 commits intov1/devfrom
Conversation
- Directive now accepts a boolean argument; passing false removes managed attributes so toggling the property is fully reversible - Marks `attributes` as protected readonly with docs for subclassing - Removes the feature from uui-textarea (password managers don't target textareas) - Adds tests for default state (attrs absent) and toggle true→false (attrs removed) - Fixes JSDoc on disablePasswordManagers properties to match rest of file Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a reusable Lit directive in uui-base to apply vendor-specific “ignore” attributes for common password managers, and exposes a disablePasswordManagers boolean API on form controls so consumers can opt into that behavior.
Changes:
- Introduces
uuiDisablePasswordManagersdirective and exports it from@umbraco-ui/uui-base. - Adds
disablePasswordManagers/disable-password-managerstouui-inputand delegates it throughuui-combobox. - Adds the same property + directive usage to
uui-textarea, plus new/updated tests and a Storybook example (input).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/uui-textarea/lib/uui-textarea.element.ts | Adds disablePasswordManagers API and applies directive to <textarea>. |
| packages/uui-input/lib/uui-input.test.ts | Adds a test for the enabled-state password-manager attributes. |
| packages/uui-input/lib/uui-input.story.ts | Adds a Storybook story demonstrating the new API. |
| packages/uui-input/lib/uui-input.element.ts | Adds disablePasswordManagers API and applies directive to <input>. |
| packages/uui-combobox/lib/uui-combobox.element.ts | Adds disablePasswordManagers API and forwards it to inner <uui-input>. |
| packages/uui-base/lib/index.ts | Re-exports directives from the base package entrypoint. |
| packages/uui-base/lib/directives/index.ts | Adds directives subpath barrel export. |
| packages/uui-base/lib/directives/disable-password-managers.test.ts | Adds directive tests for applied attributes. |
| packages/uui-base/lib/directives/disable-password-managers.directive.ts | Implements the directive that sets password-manager ignore attributes. |
Comments suppressed due to low confidence (3)
packages/uui-textarea/lib/uui-textarea.element.ts:316
- As written, toggling
disablePasswordManagersfromtrueback tofalsewill not remove the previously set password-manager ignore attributes, because the directive sets attributes imperatively and the''branch doesn’t clean them up.
Once the directive supports an enabled argument, prefer always applying it and passing the boolean so it can remove attributes when disabled.
static styles = [
css`
:host {
position: relative;
packages/uui-textarea/lib/uui-textarea.element.ts:160
- The PR description mentions adding
disablePasswordManagerstouui-inputanduui-combobox, but this change also introduces the API onuui-textarea. Please update the PR description (and/or changelog/release notes if applicable) so consumers are aware of the new attribute onuui-textareatoo.
super();
this.addEventListener('mousedown', () => {
this.style.setProperty('--uui-show-focus-outline', '0');
});
packages/uui-textarea/lib/uui-textarea.element.ts:160
disablePasswordManagersintroduces new behavior onuui-textarea, but there are no corresponding assertions inuui-textarea.test.ts. Since this package already has tests, please add coverage for: default state (no attributes), enabled state (attributes set), and toggling back to disabled (attributes removed).
super();
this.addEventListener('mousedown', () => {
this.style.setProperty('--uui-show-focus-outline', '0');
});
packages/uui-base/lib/directives/disable-password-managers.directive.ts
Outdated
Show resolved
Hide resolved
- Add directives/index to uui-base rollup entry points so the directive is a proper named sub-path in the published package - Fix JSDoc subclassing example (class fields are own properties, not prototype properties — show an inline override instead) - Fix != to !== in directive constructor guard (match Lit convention) - Add @type/@attr/@default JSDoc tags to uui-combobox disablePasswordManagers property (consistent with rest of file) - Add disablePasswordManagers tests to uui-combobox covering default state, delegation to inner uui-input, and toggle back to false Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1346.westeurope.azurestaticapps.net |



Summary
UUIDisablePasswordManagersDirectiveinuui-base/lib/directives— a Lit element directive that sets/removes vendor-specific ignore attributes for 1Password, Bitwarden, Dashlane, and LastPassdisablePasswordManagersboolean property (attr:disable-password-managers) touui-inputanduui-combobox; intentionally excluded fromuui-textarea(password managers don't target textareas)truetofalseremoves all managed attributesattributesfield isprotected readonlyto support subclassing when new password managers need to be addeddirectives/indextouui-baserollup entry points so the directive is properly published as a named sub-pathSupported password managers
data-1p-ignoredata-bwignoredata-form-type="other"data-lpignore="true"This matches the set previously maintained in the old backoffice.
Test Plan
uui-basedirective tests: attributes applied ontrue, absent onfalse, removed when toggled back tofalseuui-inputtests: default state clean, attributes applied ontrue, removed on toggle back tofalseuui-comboboxtests: delegatesdisablePasswordManagersto inneruui-input, toggle back tofalseremoves attributes<uui-input disable-password-managers>suppresses 1Password/Bitwarden/Dashlane/LastPass in browser<uui-combobox disable-password-managers>delegates correctly to the inneruui-input🤖 Generated with Claude Code