Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/components/CommandPalette.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ useEventListener(document, 'keydown', handleGlobalKeydown)
type="text"
:placeholder="viewMeta.placeholder"
no-correct
no-password-manager
size="lg"
Comment thread
serhalp marked this conversation as resolved.
class="w-full"
:aria-describedby="inputDescribedBy"
Expand Down
15 changes: 13 additions & 2 deletions app/components/Input/Base.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { noCorrect } from '~/utils/input'
import { noCorrect, noPasswordManager } from '~/utils/input'

const model = defineModel<string>({ default: '' })

Expand All @@ -16,6 +16,12 @@ const props = withDefaults(
noCorrect?: boolean
/** Keyboard shortcut hint */
ariaKeyshortcuts?: string
/**
* Prevents most common password managers from recognizing the input as a password field.
* Note: This is not a standard HTML attribute but vendor-specific data-* attributes.
* @default false
*/
noPasswordManager?: boolean
}>(),
{
size: 'md',
Expand All @@ -36,13 +42,18 @@ defineExpose({
focus: () => el.value?.focus(),
blur: () => el.value?.blur(),
})

const inputAttrs = computed(() => ({
...(props.noCorrect ? noCorrect : {}),
...(props.noPasswordManager ? noPasswordManager : {}),
}))
Comment on lines 19 to +49
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

New noPasswordManager behavior is introduced here but isn’t covered by the existing Nuxt/Vitest component tests for InputBase (see test/nuxt/components/Input/Base.spec.ts, which currently covers noCorrect). Please add a test that verifies the expected data-* attributes are present when noPasswordManager is true and absent when false, so this behavior doesn’t regress silently.

Copilot generated this review using guidance from repository custom instructions.
</script>

<template>
<input
ref="el"
v-model="model"
v-bind="props.noCorrect ? noCorrect : undefined"
v-bind="inputAttrs"
@focus="emit('focus', $event)"
@blur="emit('blur', $event)"
class="appearance-none bg-bg-subtle border border-border font-mono text-fg placeholder:text-fg-subtle transition-[border-color,outline-color] duration-300 hover:border-fg-subtle outline-2 outline-transparent outline-offset-2 focus:border-accent focus-visible:outline-accent/70 disabled:(opacity-50 cursor-not-allowed)"
Expand Down
12 changes: 12 additions & 0 deletions app/utils/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@ export function isKeyWithoutModifiers(event: KeyboardEvent, key: string): boolea
}

export const DATE_INPUT_MAX = '9999-12-31'

/** Attributes to prevent password managers from recognizing an input as a password field. */
export const noPasswordManager = {
/* ProtonPass, https://stackoverflow.com/a/51272839 */
['data-protonpass-ignore']: 'true',
/* LastPass, https://stackoverflow.com/a/51272839 */
['data-lpignore']: 'true',
/* 1Password, https://stackoverflow.com/a/51272839 */
['data-1p-ignore']: 'true',
/* Bitwarden, https://stackoverflow.com/questions/41945535/html-disable-password-manager#comment139327111_51272839 */
['data-bwignore']: 'true',
} as const
Loading