Remove "Paste & match style" on plain text inputs

This commit is contained in:
Jamie
2025-11-20 07:52:12 -08:00
committed by GitHub
parent 90c0fc7da9
commit 8e68e2051b

View File

@@ -201,7 +201,15 @@ export const setup = (
template.push({ label: i18n('icu:editMenuPaste'), role: 'paste' });
}
if (editFlags.canPaste && !isImage) {
// It seems like `canEditRichly` is unreliable for `contenteditable`
// But `formControlType` will tell us if the element is some native
// input/button/etc, and any `contenteditable` should be "none"
const isLikelyRichTextEditor = params.formControlType === 'none';
if (
editFlags.canPaste &&
(editFlags.canEditRichly || isLikelyRichTextEditor) &&
!isImage
) {
template.push({
label: i18n('icu:editMenuPasteAndMatchStyle'),
role: 'pasteAndMatchStyle',