Make closeOnLocationChange optional

There should be an option to not close the dialog on location change.