从输出html中删除了工具提示弹出框内的Bootstrap输入字段 [英] Bootstrap input field inside tooltip popover removed from output html

查看:68
本文介绍了从输出html中删除了工具提示弹出框内的Bootstrap输入字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我使用boostrap 4.3.1并包含popper 1.14.7.

Hello i`m using boostrap 4.3.1 and included popper 1.14.7.

通常,我可以在弹出窗口/工具提示的内容中添加输入字段.从那时起我就没有了,但是当我在内容中输入字段时,只有文本是可见的.

Normally I can add input fields in the content of the popup/tooltip. I don`t since when, but at the moment when I put input field in the content then only the text is visible.

当我查看源代码(编译的html)时,我可以看到popper或bootstrap删除了输入字段.我有什么问题吗?

When I look in the source (compiled html) I can see that popper or bootstrap removed the input fields. Do I something wrong?

    var options = {
        html: true,
        // content: function(){ return $(".amountElec.popup").html();},
        placement: "bottom",
        container: "body"
    };
    
    $(function(){
        $('#manualinput').popover(options);
    })

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>


<div id="manualinput" 
     data-container="body" 
     data-toggle="popover"  
     data-content="test <input name='test' type='text' value='2'>" 
     data-html="true" 
     data-placement="bottom">
     
     OPEN TOOLTUP
</div>

推荐答案

我找到了解决方法...

I found the solution...

我的情况是将其添加到javascript中:

I my case add this to the javascript:

        var myDefaultWhiteList = $.fn.tooltip.Constructor.Default.whiteList;
        myDefaultWhiteList.input = [];

https://getbootstrap.com/docs/4.3/getting-开始/javascript/#sanitizer

这篇关于从输出html中删除了工具提示弹出框内的Bootstrap输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆