Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$ionicActionSheet don't close when change route #1318

Closed
Chofoteddy opened this issue May 9, 2014 · 2 comments
Closed

$ionicActionSheet don't close when change route #1318

Chofoteddy opened this issue May 9, 2014 · 2 comments

Comments

@Chofoteddy
Copy link

I have the next code:

$ionicActionSheet.show({
    buttons: [
       {text: 'Mi Perfil'},
       {text: 'Mi Cuenta'},
       {text: 'Cerrar Sesion'},
       {text: 'Acerca de'},
    ],
    titleText: 'Opciones',
    cancelText: 'Cancelar',
    buttonClicked: function (index) {
        switch (index) {
            case 1:
                $state.transitionTo('app.user');
                break;

            case 2:
                $scope.logout(); // $state.transitionTo('index.login')
                break;
        }
        // return true;
    },
    cancel: function () {
        return;
    }
});

When not return anything, the redirect works correctly but does not close the menu. When I return true, the menu closes, but the event page transition is not executed because the event is stopped with the return.

CodePen: http://codepen.io/anon/pen/syCkL (I could not make it work in codepen.io)

@Chofoteddy Chofoteddy assigned ajbraus and ajoslin and unassigned ajbraus May 9, 2014
@ajoslin
Copy link
Contributor

ajoslin commented Jun 11, 2014

Added cancelOnStateChange option, default true.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants