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

Method _handleChange

packages/main/src/Input.ts:1197–1225  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1195 }
1196
1197 _handleChange() {
1198 if (this._clearIconClicked) {
1199 this._clearIconClicked = false;
1200 return;
1201 }
1202
1203 const fireChange = () => {
1204 if (!this._isChangeTriggeredBySuggestion) {
1205 this.fireDecoratorEvent(INPUT_EVENTS.CHANGE);
1206 }
1207 this.previousValue = this.value;
1208 this.typedInValue = this.value;
1209 this._isChangeTriggeredBySuggestion = false;
1210 };
1211
1212 if (this.previousValue !== this.getInputDOMRefSync()!.value) {
1213 // if picker is open there might be a selected item, wait next tick to get the value applied
1214 if (this.Suggestions?._getPicker()?.open && this._flattenItems.some(item => item.hasAttribute("ui5-suggestion-item") && (item as SuggestionItem).selected)) {
1215 this._changeToBeFired = true;
1216 } else {
1217 fireChange();
1218
1219 if (this._enterKeyDown) {
1220 this.fireDecoratorEvent("_request-submit");
1221 submitForm(this);
1222 }
1223 }
1224 }
1225 }
1226
1227 _clear() {
1228 const valueBeforeClear = this.value;

Callers 2

_onfocusoutMethod · 0.95
_confirmMobileValueMethod · 0.95

Calls 4

getInputDOMRefSyncMethod · 0.95
submitFormFunction · 0.85
hasAttributeMethod · 0.80
_getPickerMethod · 0.45

Tested by

no test coverage detected