MCPcopy Create free account
hub / github.com/UI5/webcomponents / onBeforeRendering

Method onBeforeRendering

packages/main/src/TabContainer.ts:378–406  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

376 }
377
378 onBeforeRendering() {
379 this._itemsFlat = this._flatten(this.items);
380 if (!this._itemsFlat.length) {
381 return;
382 }
383
384 // update selected tab
385 const selectedTab = this._itemsFlat.find((tab): tab is Tab => !tab.isSeparator && (tab as Tab).selected);
386
387 if (selectedTab) {
388 this._selectedTab = selectedTab;
389 } else if (!this.noAutoSelection) {
390 this._selectedTab = this._itemsFlat[0] as Tab;
391 } else {
392 this._selectedTab = undefined;
393 }
394
395 walk(this.items, item => {
396 if (!item.isSeparator) {
397 (item as Tab)._selectedTabReference = this._selectedTab;
398 }
399 });
400
401 this._sendStripPresentationInfos(this.items);
402
403 if (!this._animationRunning) {
404 this._contentCollapsed = this.collapsed;
405 }
406 }
407
408 onAfterRendering() {
409 if (!this.items.length) {

Callers

nothing calls this directly

Calls 3

_flattenMethod · 0.95
walkFunction · 0.85

Tested by

no test coverage detected