Opened 4 years ago

Last modified 2 years ago

#18767 new defect

<input type="file"> askes input twice.

Reported by: ReneRene Owned by:
Priority: undecided Milestone: 1.14
Component: Core Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:

Description

I would like to use this for taking pictures: http://mobilehtml5.org/ts/?id=23

<input type="file" accept="image/*" capture="camera">

This is asking me twice to take a picture. This is only whithin DoJo?. So, I can make pictures with the phone build in camera but pressing the button once asks two times to make a picture.

As soon as I remove the required "dojox/mobile", it is working as expected.

Is this a bug?

Change History (7)

comment:1 Changed 4 years ago by bill

Possibly it's from dojo/touch.js. You could test this by instead of requiring dojox/mobile, try just requiring dojo/touch, and then set document.body.dojoClick = true;

comment:2 in reply to:  1 Changed 4 years ago by ReneRene

Replying to bill:

Possibly it's from dojo/touch.js. You could test this by instead of requiring dojox/mobile, try just requiring dojo/touch, and then set document.body.dojoClick = true;


You are right bill !

I have required only dojo/touch.

When I set document.body.dojoClick = false; ==> asking 1x for input. When I set document.body.dojoClick = true; ==> asking 2x for input.

Maybe I can use this to solve my problem. Not sure.

Question remains: Is this a bug?

Last edited 4 years ago by ReneRene (previous) (diff)

comment:3 Changed 4 years ago by bill

I guess it's a bug. And maybe you can workaround it by setting dojoClick=false on that one node. dojo/touch.js has a bunch of code to vary its behavior depending on the node type, but I guess this case isn't covered.

comment:4 Changed 4 years ago by dylan

Milestone: tbd1.12

comment:5 in reply to:  3 Changed 4 years ago by ReneRene

Replying to bill:

I guess it's a bug. And maybe you can workaround it by setting dojoClick=false on that one node. dojo/touch.js has a bunch of code to vary its behavior depending on the node type, but I guess this case isn't covered.


Your solution is really working great! Just for the record and maybe to help somebody else:

Solution/workaround:

Place the input in a div container:

<div id="NoTouchArea">
     <br/>
     <input id="takePictureInput" type="file" capture="camera" accept="image/*">
     <br/>
     <br/>
</div>

Then disable the touch:

dojo.byId("NoTouchArea").dojoClick = false;

Now the camera shows only once!

comment:6 Changed 4 years ago by dylan

Component: GeneralCore

comment:7 Changed 2 years ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.