在tippy.js div中添加一个表单(在cytoscape.js的节点中),但文本输入和按钮不活动

问题描述 投票:1回答:1

我有一个cytoscape.js图,在每个节点中我添加了一个tippy.js工具提示。在工具提示中,我有一个带有文本输入的表单。一切看起来都很好,但工具提示中的文本输入和按钮不活动。

我已经改变了div的z-index,所以应该在cytoscape画布上。仍然没有成功。

        var makeTippy = function (node, text) {

            return tippy(node.popperRef(), {
                    content: function () {
                            var div = document.createElement('div');
                            div.innerHTML = '<form name="input" >' +
                                                'For :  '+ node._private.data.name+'<br>'+
                                                'Value :<br>'+
                                                '<input type="text" name="value"><br>'  +                       
                                                '<input type="submit" value="Submit" />' +
                                                '</form>';
                            div.style.width = "100px";
                            div.style.height = "120px";
                            //div.style.background = "black";
                            div.style.color = "white";
                            div.style.position= "relative";
                            div.style.zIndex = "1500";                  
                            return div;
                    },
                    trigger: 'manual',
                    arrow: true,
                    placement: 'bottom',
                    hideOnClick: false,
                    multiple: true,
                    followCursor: true,
                    theme: 'run', 
                    sticky: true
                });

        };
html forms tooltip cytoscape.js
1个回答
1
投票

最后,它通过将tippy实例的interactive设置为true来工作:

互动:真的,

© www.soinside.com 2019 - 2024. All rights reserved.