MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / inheritAttributes

Function inheritAttributes

core/src/utils/helpers.ts:103–117  ·  view source on GitHub ↗
(el: HTMLElement, attributes: string[] = [])

Source from the content-addressed store, hash-verified

101 * does not trigger a re-render.
102 */
103export const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {
104 const attributeObject: Attributes = {};
105
106 attributes.forEach((attr) => {
107 if (el.hasAttribute(attr)) {
108 const value = el.getAttribute(attr);
109 if (value !== null) {
110 attributeObject[attr] = el.getAttribute(attr);
111 }
112 el.removeAttribute(attr);
113 }
114 });
115
116 return attributeObject;
117};
118
119/**
120 * List of available ARIA attributes + `role`.

Callers 13

componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
componentWillLoadMethod · 0.90
attributes.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected