PDFJsAnnotations icon indicating copy to clipboard operation
PDFJsAnnotations copied to clipboard

Adding undo feature and Add text doesn't work in iPad

Open netmastan opened this issue 4 years ago • 10 comments

Hi, is it possible to add undo feature? It will be a great add-on.

And also I noticed Add text doesn't work on iPad.

Thanks for your great tool

netmastan avatar Nov 06 '21 11:11 netmastan

It's possible to add undo/redo feature by storing all elements in an array. I'll try to add it. I'll look into the iPad issue as well.

RavishaHesh avatar Nov 08 '21 05:11 RavishaHesh

Thank you, Sir. If you click outside the canvas area(close to any edges) you get the text box but when you click on the canvas you don't the text box. You get the error "Intervention] Ignored attempt to cancel a touch start event with cancelable=false, for example, because scrolling is in progress and cannot be interrupted."

You can't also touch the canvas to pull up and down on iPad and iPhone. You can replicate this in-browser using Developer tool -> Device tool bar-> switching iPad or other devices.

netmastan avatar Nov 08 '21 05:11 netmastan

It is possible that the button to add text works like the one to add rectangle, since it does not work for me on iPad either.

Thanks for your great tool (x2)

jesesqui avatar Nov 08 '21 23:11 jesesqui

I force scroll like this:

div id="pdf-container" class="scroll"></div css

.scroll { width: 1000px; height: 1200px; background-color: #ccc; overflow-y: scroll; margin-left: auto; margin-right: auto; }

js $(".scroll").hover(function() { var oldScrollPos = $(window).scrollTop();

$(window).on('scroll.scrolldisabler', function(event) { $(window).scrollTop(oldScrollPos); event.preventDefault(); }); }, function() { $(window).off('scroll.scrolldisabler'); });

jesesqui avatar Nov 09 '21 00:11 jesesqui

I changed this functions lines in fabric.min.js

line 4792 function() { var r = fabric.util.addListener, n = fabric.util.removeListener, s = { passive: !0 /de 1 a 0/ };

line 4907 _onTouchStart: function(t) { //t.preventDefault(), /disable/

line 4950 _onMouseMove: function(t) { //!this.allowTouchScrolling && t.preventDefault && t.preventDefault(), /disable/

and works in mode touch in Chrome.

jesesqui avatar Nov 18 '21 00:11 jesesqui

its posible add placerholder to itextboxs generated

jesesqui avatar Nov 23 '21 19:11 jesesqui

its posible add placerholder to itextboxs generated

Placeholder means? A default value?

RavishaHesh avatar Nov 24 '21 04:11 RavishaHesh

the text which show before starting write and hide when write something. The short hint is displayed in the input field before the user enters a value. like this image. Captura de Pantalla 2021-11-24 a la(s) 9 46 43

jesesqui avatar Nov 24 '21 15:11 jesesqui

any update on this? Thanks

janlord01 avatar Jan 17 '22 08:01 janlord01

any update on this? Thanks

I don't see any options in fabric.js itself to provide placeholders http://fabricjs.com/docs/fabric.Textbox.html#Textbox but this might be able to implement using a custom click handler. But since it has resize handlers click handler might override that function

RavishaHesh avatar Jan 17 '22 08:01 RavishaHesh