Skip to content

feat: adds directive and property to disable password managers#1346

Open
iOvergaard wants to merge 6 commits intov1/devfrom
v1/feature/disable-password-managers
Open

feat: adds directive and property to disable password managers#1346
iOvergaard wants to merge 6 commits intov1/devfrom
v1/feature/disable-password-managers

Conversation

@iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Mar 16, 2026

Summary

  • Adds UUIDisablePasswordManagersDirective in uui-base/lib/directives — a Lit element directive that sets/removes vendor-specific ignore attributes for 1Password, Bitwarden, Dashlane, and LastPass
  • Adds disablePasswordManagers boolean property (attr: disable-password-managers) to uui-input and uui-combobox; intentionally excluded from uui-textarea (password managers don't target textareas)
  • Directive is fully reversible: toggling from true to false removes all managed attributes
  • attributes field is protected readonly to support subclassing when new password managers need to be added
  • Adds directives/index to uui-base rollup entry points so the directive is properly published as a named sub-path

Supported password managers

Manager Attribute
1Password data-1p-ignore
Bitwarden data-bwignore
Dashlane data-form-type="other"
LastPass data-lpignore="true"

This matches the set previously maintained in the old backoffice.

Test Plan

  • uui-base directive tests: attributes applied on true, absent on false, removed when toggled back to false
  • uui-input tests: default state clean, attributes applied on true, removed on toggle back to false
  • uui-combobox tests: delegates disablePasswordManagers to inner uui-input, toggle back to false removes attributes
  • Verify <uui-input disable-password-managers> suppresses 1Password/Bitwarden/Dashlane/LastPass in browser
  • Verify <uui-combobox disable-password-managers> delegates correctly to the inner uui-input

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 16, 2026 13:58
- 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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 uuiDisablePasswordManagers directive and exports it from @umbraco-ui/uui-base.
  • Adds disablePasswordManagers / disable-password-managers to uui-input and delegates it through uui-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 disablePasswordManagers from true back to false will 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 disablePasswordManagers to uui-input and uui-combobox, but this change also introduces the API on uui-textarea. Please update the PR description (and/or changelog/release notes if applicable) so consumers are aware of the new attribute on uui-textarea too.
    super();

    this.addEventListener('mousedown', () => {
      this.style.setProperty('--uui-show-focus-outline', '0');
    });

packages/uui-textarea/lib/uui-textarea.element.ts:160

  • disablePasswordManagers introduces new behavior on uui-textarea, but there are no corresponding assertions in uui-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');
    });

iOvergaard and others added 2 commits March 16, 2026 15:06
- 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>
@sonarqubecloud
Copy link

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1346.westeurope.azurestaticapps.net

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.

2 participants