feat(toolbar): add titlePlacement prop to control title position relative to content#31034
feat(toolbar): add titlePlacement prop to control title position relative to content#31034brandyscarney wants to merge 7 commits intonextfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| return this.titlePlacement; | ||
| } | ||
|
|
||
| return getIonTheme(this) === 'ionic' || getIonTheme(this) === 'ios' ? 'center' : 'start'; |
There was a problem hiding this comment.
While this property doesn't work with ios or md yet, this will be needed eventually when we update them to work with it.
| * `"center"`: The title will appear in the center of the toolbar. | ||
| * `"end"`: The title will appear to the right of the toolbar content in LTR and to the left in RTL. | ||
| */ | ||
| @Prop() titlePlacement?: 'start' | 'center' | 'end'; |
There was a problem hiding this comment.
I chose to add titlePlacement to the toolbar because it controls all the positioning logic, but if we would prefer to add placement as a property on ion-title we could assign it there and pass it up to ion-toolbar.
There was a problem hiding this comment.
I think this fixed a bug. The only reason the title wasn't centered in the two cases where it was left-aligned is because it had size="small" on it. I don't think this should change the alignment but I can change it back if desired.
Issue number: internal
What is the current behavior?
The
ionictheme currently only supports aligning the toolbar title to the center.What is the new behavior?
titlePlacementproperty to toolbarionictheme as it is the only theme that supports the new center implementation"start"to place the title to the left in LTR and to the right in RTL"center"to center the title within the toolbar"end"to place the title to the right in LTR and to the left in RTLtitle-placementwhich takes screenshots for theionictheme onlyDoes this introduce a breaking change?
Other information
Preview