MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / childrenStyle

Method childrenStyle

core/src/components/toolbar/toolbar.tsx:62–86  ·  view source on GitHub ↗
(ev: CustomEvent<StyleEventDetail>)

Source from the content-addressed store, hash-verified

60
61 @Listen('ionStyle')
62 childrenStyle(ev: CustomEvent<StyleEventDetail>) {
63 ev.stopPropagation();
64
65 const tagName = (ev.target as HTMLElement).tagName;
66 const updatedStyles = ev.detail;
67 const newStyles = {} as CssClassMap;
68 const childStyles = this.childrenStyles.get(tagName) || {};
69
70 let hasStyleChange = false;
71 Object.keys(updatedStyles).forEach((key) => {
72 const childKey = `toolbar-${key}`;
73 const newValue = updatedStyles[key];
74 if (newValue !== childStyles[childKey]) {
75 hasStyleChange = true;
76 }
77 if (newValue) {
78 newStyles[childKey] = true;
79 }
80 });
81
82 if (hasStyleChange) {
83 this.childrenStyles.set(tagName, newStyles);
84 forceUpdate(this);
85 }
86 }
87
88 render() {
89 const mode = getIonMode(this);

Callers

nothing calls this directly

Calls 2

setMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected