-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Nav bar title set async #2615
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
Comments
You're talking about setting it declaratively in the directive right (eg: You can use |
No, like this:
If the title is set as a constant at the instantiation of the controller, everything's right. If I set it delayed as in a promise's then() method, it fails. Also, setting it with |
Ahh I see. Still, I'd think Here's a codepen showing the title being set async. |
The thing is that I do this after pushing another view. |
You won't need to use the nightly to get this functionality, I was just doing so to give an example. I think I'm getting the function names mixed up, though because it was renamed recently:
You can toggle the version in the navigation docs as well, to see the differences. |
Hi. I have been trying to make sense of this today and I believe there is a bug involved. Look at the HomeTabCtrl. It sets an initial name of the person - which goes into the title as expected - but then it usually fails to update it 100ms later. If you click a little bit back and forth between home and facts and scientific facts you will see that it sometimes updates the title, but often not. From what I have seen, there seems to be a difference in behavior for the first view vs. the one that you switch to, regardless if you are using $ionicNavBarDelegate or an angular expression to set the title. |
You're right, I was thinking this was just to force usage of the navbar api to change the title, but it is in fact a bug. Working on a fix right now, thanks for pointing this out! |
Hey @grimmegutt - still looking into this, haven't had much time to look deeper into it but it appears that it's related to the |
It's best to use the |
@adamdbradley that directive is only in nightly for now, right? |
Testing beta14 and setting my title with:
The title is set before the animation and disappears right after it finishes. Edit: |
Removing Summary:
|
Hi @OminStyle , you are quite right. |
@OminStyle: only |
When using |
+1. Same problem as @jbdemonte ion-nav-title width is calculated incorrectly. I actually see it display correctly for a flash, and then shrink and truncate the title Edit: It seems to work if I remove ng-bind which makes no sense. Wrong size title: Correct size title: |
EDIT: I'm not sure what's up with the lack of line breaks w/ my code. Putting additional breaks in removes the code formatting at the break, but also puts in all of the other line breaks that are supposed to be there. Context: I just jumped into a project w/ ionic + sass implemented. Not sure if this is a bug isolated to the SASS implementation or not. There should probably be a SASS variable for $bar-title-width used in this class. If anyone is interested, I can make some PR's to update things. Here's my ionic HTML: Here's the problem in my _ionic.scss: Here's an updated version:
Right now, option #1 is easiest for me, but I wouldn't think it's ideal |
There seems to be a problem when setting the title attribute of ion-view, if I set it after a promise is resolved the width is wrong. If it's a constant string there is no problem.
The text was updated successfully, but these errors were encountered: