简体   繁体   English

初始化后summernote textarea的宽度为0

[英]summernote textarea's width is 0 after init

I have a basic summernote setup in my website that goes something like this:我的网站上有一个基本的summernote设置,如下所示:

inputGroupHTML = `
            <div class="screen-item-container">
                <div class="input-group col-lg-12 col-sm-12 col-xs-12">
                    <div class="summernote form-control criteria-field controls" >
                        <p>hi</p>
                    </div>
                </div>
            </div>
            `;

                $(document).ready(function () {
                    $(".summernote").summernote({
                        placeholder: tooltip, toolbar: [
                            ['style', ['style']],
                            ['font', ['bold', 'underline', 'clear']],
                            ['color', ['color']],
                            ['para', ['ul', 'ol', 'paragraph']],
                        ]

                    });
                });

I added some styles for width and height of the textarea, but when it renders it looks like this我为textarea的宽度和高度添加了一些styles,但是当它渲染时看起来像这样在此处输入图像描述

with the textarea disappearing.随着文本区域消失。

Checking inspection gives me this:检查检查给了我这个: 在此处输入图像描述

I'm not sure what caused it so any help would be appreiated.我不确定是什么原因造成的,所以会得到任何帮助。 I wont be able to provide all the code since this is company stuff, but I'll try to provide relevant code if needed.由于这是公司的东西,我将无法提供所有代码,但如果需要,我会尝试提供相关代码。

$(".summernote").summernote({
         height: 150,
         placeholder: tooltip, 
         toolbar: [['style', ['style']],
                   ['font', ['bold', 'underline', 'clear']],
                   ['color', ['color']],
                   ['para', ['ul', 'ol', 'paragraph']],
                  ]
});

or try to add width in html或尝试在 html 中添加宽度

<div class="summernote form-control criteria-field controls" style="height:300px" > 
     <p>hi</p> 
</div>

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

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