Cordova Slack Digest

Wed, 28 Apr 2021 08:23:02 GMT

User count: 4466

Join the conversation at slack.cordova.io

Channel #general (3 messages)


Tue, 27 Apr 2021 13:47:32 GMT

@ivan.harpley says

Question: Is the Cordova Browser platform still supported? Is there documentation somewhere that describes how to deploy the browser build to the web server?

Tue, 27 Apr 2021 13:51:00 GMT

@andrew867 says

https://cordova.apache.org/docs/en/latest/

Wed, 28 Apr 2021 07:37:35 GMT

@abhishekkumar619z says

Does anyone know how to make accessibility service work in android? I have a stackoverflow question posted https://stackoverflow.com/questions/67224206/accessibility-service-not-showing-up-android-cordova|here Please let me know if you can help me solve it.

Channel #cordova-ios (1 messages)


Tue, 27 Apr 2021 14:31:42 GMT

@dpogue says

WebKit changes in iOS 14.5: https://firt.dev/ios-14.5/ (as always, just because something is supported in Safari on iOS doesn't mean it will work in WKWebView)

Channel #cordova-windows (6 messages)


Tue, 27 Apr 2021 09:20:17 GMT

@andrew867 says

I just asked this in the general channel - Didn’t see the specific windows channel before :

I’m trying to attach to the touch[start|move|end] events via a windows 10 build. In a browser these events always trigger, but it doesn’t trigger the event handlers that I’ve bound via the installed windows 10 build.  I’ve tried to attach the handlers via addEventListener on the both the specific node the touch events are supposed to be triggering against as well as other nodes up to the window.

Of cause, I’ve also tried other binding for example via $el.on  

It’s as if the touch events are disabled within Cordova on windows 10.

Is there someway to enable these touch events in the Cordova build on windows 10?

Or can anyone confirm that windows 10 builds trigger these events?

Tue, 27 Apr 2021 09:21:00 GMT

@andrew867 says

I’m just building a simple test case without any of my normal libs included, incase there’s something I’ve added which is causing it to stop triggering these events.

Tue, 27 Apr 2021 09:39:10 GMT

@andrew867 says

The mouse[down|move|up] events are triggering. But of cause, these don’t include the .touches property which a regular touchEvent includes. Which means I can not attach to 2, or more, finger gestures, such as a simple pinch to zoom, via the mouse[down|move|up] events.

Tue, 27 Apr 2021 10:14:02 GMT

@andrew867 says

I’ve tested my test case, which is just a simple console.log via the event handlers, in Chrome and edge on the same device, and all the events trigger as expected.

I’m about to try a range of different setting for the CSS touch-action: property, and the old browser specific --ms-touch-action: property too, but I would have thought the standard events would still trigger regardless of how these are set.

Tue, 27 Apr 2021 12:22:41 GMT

@andrew867 says

The events pointer[down|move|up] are triggering, with a PointerEvent which include a property pointerType which is set to touch -

It appears that the PointerEvent includes a number of flags and properties which will allow me use them in place of the standard touch[start|move|stop] events.

  • e.isPrimary - indicates if it was the first of N points or not
  • e.pointerId - will allow me to track any number of points / individual fingers I should be able to reproduce some sort of polyfill that replicates the e.touches property of the standard TouchEvent sufficiently that I can call the same logic directly - The rest, such as e.[x|y] will allow me to calculate the type of gesture just as I’m doing with the standard event.

Tue, 27 Apr 2021 13:58:35 GMT

@andrew867 says

That works. I found that the TouchEvent type is also not defined, which given that the respective events aren’t triggered is understandable.

Anyway, I’ve used this as a test before enabling the polyfill that works something like the following :

  var newTouchEvent = function(eventType, e){

     var touchEvent = new Event(eventType); 
     // clone & expand the event so
     // it supports touch properties
     // eg :
     for( p in e ) { touchEvent[p] - e[p]; } // change to explicit clone

     // track down / move / end states 
     // so the array of touches contains the
     // x/y and other props
     touchEvent.touches = trackGlobalTouches(e);     

     // ETA - some features requires the changedTouches 
     // especially useful for more 
     touchEvent.changedTouches = trackChangedTouches(eventType, e);   

     // There might be other TouchEvent.properties 
     // which need setting too

     // dispatch the event, from the originating node
     e.target.dispatchEvent(touchEvent);
  }

   // bind the pointer[down|move|up] events on the doc
   docuemnt.addEventistener("pointerdown", ....
}```
ETA : Let me know if you want an updated sample, this is just from memory.

Boom all my SVG touch events started to work.