"touch-action: none" in script?

Developer
Sep 3, 2013 at 1:10 PM
Edited Sep 3, 2013 at 2:26 PM
Can I add "touch-action: none" CSS property in script? I made a library to add a touch-enabled element to the page, but I don't know how to add the property simply with Hand.js.

As a workaround I'm using this code:
        if (this.contentDiv.style["touch-action"] !== undefined)
            this.contentDiv.style["touch-action"] = "none";
        else if (this.contentDiv.style["-ms-touch-action"] !== undefined)
            this.contentDiv.style["-ms-touch-action"] = "none";
        else this.contentDiv["handjs_forcePreventDefault"] = true;
this.contentDiv.handjs_forcePreventDefault will be fine but TypeScript simply does not allow this :/

Do we have any other simpler way to do this? I think overriding style property itself will be super-hard work...
Coordinator
Sep 3, 2013 at 1:47 PM
I think you're doing the best thing
Developer
Sep 3, 2013 at 2:33 PM
I wish they were some better ways, but I'm fine with this now. Thank you for the information :)