Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Cannot interact with DOM while ons-action-sheet is active
-
If I use the example code from https://onsen.io/v2/api/js/ons-action-sheet.html.
I can’t interact in the “then”-part:ons.openActionSheet({ title: 'Source:', cancelable: true, buttons: [ 'Gallery', 'Camera', ] }).then(function (index) { switch(index) { case 0: $('#input_img').trigger('click'); // Can't do this while action-sheet is active? break; case 1: /*navigator.camera.getPicture(.......*/ break; } })
What should I do?
-
@Bassie What is the error? Can you print stuff in the
then
part?
-
No errors.
I use:$('#input_img').trigger('click');
…for when the cordova-camera-plugin fails loading (=PC).
I now check for:
if (navigator.camera){..
…before opening the Action Sheet, that also works fine.