MCPcopy Index your code
hub / github.com/UI5/webcomponents / attributeChangedCallback

Function attributeChangedCallback

packages/base/src/UI5Element.ts:688–705  ·  view source on GitHub ↗

* Do not override this method in derivatives of UI5Element * @private

(name: string, oldValue: string | null, newValue: string | null)

Source from the content-addressed store, hash-verified

686 * @private
687 */
688 attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {
689 let newPropertyValue: PropertyValue;
690 if (this._doNotSyncAttributes.has(name)) { // This attribute is mutated internally, not by the user
691 return;
692 }
693
694 const properties = (this.constructor as typeof UI5Element).getMetadata().getProperties();
695 const realName = name.replace(/^ui5-/, "");
696 const nameInCamelCase = kebabToCamelCase(realName);
697 if (properties.hasOwnProperty(nameInCamelCase)) { // eslint-disable-line
698 const propData = properties[nameInCamelCase];
699
700 const converter = propData.converter ?? defaultConverter;
701 newPropertyValue = converter.fromAttribute(newValue, propData.type);
702
703 (this as Record<string, any>)[nameInCamelCase] = newPropertyValue;
704 }
705 }
706
707 formAssociatedCallback() {
708 const ctor = this.constructor as typeof UI5Element;

Callers

nothing calls this directly

Calls 3

kebabToCamelCaseFunction · 0.85
getPropertiesMethod · 0.80
getMetadataMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…