Skip to content
Sarj Code Standards

no-blocked-input-paste

Allow clipboard input when a text control has no replacement paste handling.

Why

An editable text control that only cancels paste prevents users from entering generated passwords, authentication codes and copied data. This creates avoidable accessibility and password-manager barriers.

Fix

Allow native paste. If the product must normalize clipboard content, provide explicit replacement processing and preserve keyboard and password-manager access; review the behavior instead of applying an automatic edit.

Examples

Before — flagged Review unconditional paste cancellation
src/view.tsx
<input type="password" onPaste={(event) => event.preventDefault()} />;
After — preferred Allow native clipboard input
src/view.tsx
<input type="password" />;

References