Repository navigation
fix(angular): tabs supports conditional slot bindings - #27582
Conversation
|
|
| * Relocates the tab bar to the new slot position. | ||
| */ | ||
| private relocateTabBar(): void { | ||
| const tabBar = (this.tabBar as any).el as HTMLElement; |
There was a problem hiding this comment.
We have options here regarding the any type (and the any on L175). Our automatic generated proxies have the el property as protected. To make the types valid, we would need to disable automatically generating the proxy and manually wrap it with a public field member.
I don't think the effort of maintaining the proxy is worth the type efficiency here.
There was a problem hiding this comment.
That makes sense. It might be a good idea to include a comment for the reasoning to keep it as type any.
|
Thoughts on targeting this to |
I agree to target this to |
|
Sounds good 👍 I'll get |
thetaPC
left a comment
There was a problem hiding this comment.
LGTM, tested the build on the tabs starter.
| * Relocates the tab bar to the new slot position. | ||
| */ | ||
| private relocateTabBar(): void { | ||
| const tabBar = (this.tabBar as any).el as HTMLElement; |
There was a problem hiding this comment.
That makes sense. It might be a good idea to include a comment for the reasoning to keep it as type any.
liamdebeasi
left a comment
There was a problem hiding this comment.
Tested locally and it works great. Nice job!
Issue number: Resolves #19484
What is the current behavior?
The Angular implementation of
ion-tabsdoes not support conditional binding theslotproperty onion-tab-baror assigning a variable as the slot.For example, this usage is invalid:
This occurs because
ng-contentonly supports static content projection. It is not intended for scenarios where the content can be relocated or conditionally rendered.An example of static content projection would be:
What is the new behavior?
ion-tabssupports conditional slot bindings or a slot that is bound to a variable in Angular.The revised implementation relocates the tab bar in the
ion-tabstemplate, based on it's current slot attribute. The implementation checks the tab bar slot whenever the content changes.Does this introduce a breaking change?
Other information
Dev-build:
7.0.11-dev.11685631370.18980633