How to disable pasting image/video in ngx-quill in agular 5

Discussão em 'Angular' iniciado por Atif Hussain, Agosto 27, 2025.

  1. Atif Hussain

    Atif Hussain Guest

    I am using quill editor, its working fine but the problem is that when pasting text which include images, its also pasted it in textarea which i dont want. how could I disable it? I tried format option given on the below link but no use. https://github.com/quilljs/quill/issues/1108 following is the html

    <quill-editor #textArea [placeholder]="attribute.name"
    [formControl]="specsForm.controls[attribute.id].controls.value" [required]="attribute.isRequired"
    [readOnly]="isProductAttributeDefected || attribute.isReadOnly " [disableControl]="isProductAttributeDefected || attribute.isReadOnly"
    [maxLength]="attribute.maxLength" [modules]="editorConfig" (onEditorCreated)="editorInit($event, attribute.id, specsForm, false)">


    and this is my config in ts

    public editorConfig: {
    modules: {
    toolbar: [
    [{ header: [1, 2, false] }],
    ['bold', 'italic', 'underline'],
    ['code-block']
    ]
    },
    placeholder: 'Compose an epic...',
    theme: 'snow', // or 'bubble'
    formats: [
    'background',
    'bold',
    'color',
    'font',
    'code',
    'italic',
    'link',
    'size',
    'strike',
    'script',
    'underline',
    'blockquote',
    'header',
    'indent',
    'list',
    'align',
    'direction',
    'code-block',
    'formula'
    // 'image'
    // 'video'
    ]

    };


    I tried version 5.2.0 and 6.2.0 both

    any idea? Note: there is a hack mentioned on the given link but I would like to have a proper solution

    Continue reading...

Compartilhe esta Página