TextBox可编辑的光标重复项

时间:2019-06-20 07:02:11

标签: javascript fabricjs

我已将fabricjs文本和对象分组,试图在组内编辑文本,但在两个位置启用了光标

var object = event.target;
if (object && object.name == "WFX_OBJECTS_UNGROUPING") {
    var canvas = canvasService.getCanvas();
    var _pointer = canvas.getPointer(event.e);
    var selectedObject = canvas._searchPossibleTargets(event.target._objects, _pointer);
    if (selectedObject) {
        if (selectedObject.name == "WFX_SIMPLETEXT") {
            selectedObject.enterEditing(event.e);
            selectedObject.hiddenTextarea.focus();
        }
        canvas.setActiveObject(selectedObject);
    }
}

我希望光标会在文本编辑中显示,但它也会在画布顶部启用

0 个答案:

没有答案