繁体   English   中英

Froala 编辑器崩溃

[英]Froala Editor Crashing

当复制和粘贴文本和其他一些情况下它会崩溃。 之后就不能提交表单了。

FroalaEditor 复制粘贴 GIF

这是我的带有图像上传器的 javascript 参数:

 require('froala-editor/js/froala_editor.pkgd.min'); $(function () { 'use strict'; $('.editor').froalaEditor({ htmlAllowedEmptyTags: ['footnote'], heightMin: 400, // Set the language code. language: 'ru', imageUploadParam: 'image_param', imageUploadParams: {id: 'my_editor'}, imageUploadURL: '/admin/froala/upload-image', imageUploadMethod: 'POST', imageAllowedTypes: ['jpeg', 'jpg', 'png'], requestHeaders: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }) });

和 html:

 <div class="col-sm-6">
     <div class="form-group">
        <label for="description">Description</label>
         <textarea class="editor" rows="10" name="description" id="description" required>{{ old('description') }}</textarea>
     </div>
</div>

我也面临你的问题,今天我有一个技巧来处理它。

您可以在此处参考我对 StackOverflow 问题的回答

我猜你已经使用CSS隐藏了Froala的unlicense横幅,所以模型更改11次后它会崩溃。 这是我检测此问题的简单演示https://stackblitz.com/edit/react-froala-editor?file=style.css

div.fr-wrapper>div>a {
        /* display: none !important; */
        /* position: fixed; */
        /* z-index: -99999 !important; */
    font-size: 0px !important;
    padding: 0px !important;
    height: 0px !important;
}

在 CSS 代码中,如果我们使用display: none ,它会在第 11 次更改后崩溃。 你可以试试如果你使用display: none ,编辑后,它会在 11 次后崩溃。

我找到了一个技巧来处理这个问题,我不隐藏横幅,但我将它设置为不可见的font-size: 0padding: 0作为我上面的代码。

似乎您隐藏了许可红色 div

为了修复此错误,只需将以下样式添加到您的代码中

a[href='https://www.froala.com/wysiwyg-editor?k=u'] {
        font-size: 0px !important;
        padding: 0px !important;
        height: 0px !important;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM