Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

dialog closes on $location.search() change even when reloadOnSearch:false #445

@lkende

Description

@lkende

I noticed that when I have a dialog open and change a param using $location.search() that my dialog closes. (I have reloadOnSearch: false in my $routeProvider for the page in question). Take for example that a user interaction within a dialog sets a query param in the address without firing a route change.

Looking into dialog in angular-bootstrap js, I see relavent code:

 Dialog.prototype._bindEvents = function() {
      ....
      this.$scope.$on('$locationChangeSuccess', this.handleLocationChange);
    };


 this.handleLocationChange = function() {
        self.close();
      };

Would it not make more sense to change this event to?

this.$scope.$on('$routeChangeSuccess', this.handleLocationChange);

This appears to fix it, but hate to make modifications to code supplied by third-parties since upgrades require going back in and remembering to make modifications again. I can understand that if the route were to actually change that the dialog should close. Maybe this could be supplied in opts, or possibly check the config? I'm not sure the possibilities, but wanted to bring this up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions