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

ion-view title won't update (with fix!) #1121

Closed
clawish opened this issue Apr 12, 2014 · 5 comments
Closed

ion-view title won't update (with fix!) #1121

clawish opened this issue Apr 12, 2014 · 5 comments
Labels
needs: reply the issue needs a response from the user

Comments

@clawish
Copy link

clawish commented Apr 12, 2014

EDIT:
This post was really confusing to read. Please start reading on post#3. When you want a possible solution to the bug, you can continue to read here (post#1):


What can be changed in the ionic.bundle.js to fix this bug? It is one simple line of code in the ionView directive: the lines

$attr.$observe('title', function(val, oldVal) {
      if (val !== initialTitle) {
        navBarCtrl.setTitle(val);
      }
    });

have to be changed to

$attr.$observe('title', function(val, oldVal) {
      if (val !== initialTitle) {
        navBarCtrl.setTitle(val);
      }
        else {navBarCtrl.setTitle(initialTitle);} // line added by claw
    });

Would be nice if you'd confirm this and implement it.

@ajoslin
Copy link
Contributor

ajoslin commented Apr 30, 2014

Hi!

I don't actually understand your problem, your codepen is a bit too complicated for me to understand.

Could you simplify the codepen or explain simply what's wrong?

Thanks :-)

@clawish
Copy link
Author

clawish commented May 1, 2014

Hello there!
Thank you for your respond.
I am very sorry, my last plnkr was just horrible, big apologies.
The bug is still persistent in 1.0.0beta3.

Let's start anew and forget the post#1 (except for the solution :-) )

I created a video showing the bug (watch it first):
http://tinypic.com/player.php?v=2zp35sz%3E&s=8#.U2LB-62Swrw

The bug in short is: choosing the items does not make a problem (in terms of the page1 title gets updated), until one visits the page2. From this point on, one can change the activeItem to another one, but when you try to change it back, the title won't update!!! It seems, that always THAT title is bugged, which was active when visiting page2. See the video for a good example.

Here is a plnkr to experience the bug yourself:
http://plnkr.co/edit/XNwTvV3vLyzftPRew2e2

The suggestion made in post#1 fixes this bug.
Simply add
else {navBarCtrl.setTitle(initialTitle);}
at the proper position in code, as stated in post#1

Thank you for spending time on this bug :-)

@ajoslin
Copy link
Contributor

ajoslin commented May 9, 2014

OK, I understand now! If you have a view where the title changes back and forth, then goes back to the original, it won't work.

I fixed it a different way. It works now in the nightly builds and will be in beta.5.

@ajoslin ajoslin closed this as completed in 919d4f8 May 9, 2014
@robdmoore
Copy link

NICE! I had some hacky code to overcome this bug! Hadn't found time to do a repo for you hence why I haven't reported it. Awesome!

@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
needs: reply the issue needs a response from the user
Projects
None yet
Development

No branches or pull requests

4 participants