I am trying to open the iOS keyboard whenever the user long clicks on a button. However, right now, only the normal click is working.
Clarification: I KNOW I need to use a proxy textfield. It is also WORKING for normal clicks. I just need a way to handle when the user presses a button for a longer time .
I assume it has to do with the events allowed to trigger a keyboard opening. It only seems to work when the "touchend" event is triggered, not when it is done from within the "touchstart" event with setTimeout. Is there any workaround to this limitation?
https://jsfiddle.net/qu2nej0r/12/
let c = new fabric.Canvas(document.getElementById('cvs'));
$('#t').longpress(_ => {
let i = new fabric.IText(_.type);
c.add(i);
c.setActiveObject(i);
c.renderAll();
i.enterEditing();
}, _ => {
let i = new fabric.IText(_.type, {
left: 40,
top: 40
});
c.add(i);
c.setActiveObject(i);
c.renderAll();
i.enterEditing();
});