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

Method _input

packages/main/src/Input.ts:1273–1314  ·  view source on GitHub ↗
(e: CustomEvent<InputEventDetail> | InputEvent, eventType: string)

Source from the content-addressed store, hash-verified

1271 }
1272
1273 _input(e: CustomEvent<InputEventDetail> | InputEvent, eventType: string) {
1274 const inputDomRef = this.getInputDOMRefSync();
1275
1276 const allowedEventTypes = [
1277 "deleteWordBackward",
1278 "deleteWordForward",
1279 "deleteSoftLineBackward",
1280 "deleteSoftLineForward",
1281 "deleteEntireSoftLine",
1282 "deleteHardLineBackward",
1283 "deleteHardLineForward",
1284 "deleteByDrag",
1285 "deleteByCut",
1286 "deleteContent",
1287 "deleteContentBackward",
1288 "deleteContentForward",
1289 "historyUndo",
1290 ];
1291
1292 this._shouldAutocomplete = !allowedEventTypes.includes(eventType) && !this.noTypeahead;
1293
1294 if (e.target === inputDomRef) {
1295 this.focused = true;
1296
1297 // stop the native event, as the semantic "input" would be fired.
1298 e.stopImmediatePropagation();
1299 }
1300
1301 this.fireEventByAction(INPUT_ACTIONS.ACTION_ENTER, e as InputEvent);
1302
1303 this.hasSuggestionItemSelected = false;
1304
1305 if (this.Suggestions) {
1306 this.Suggestions.updateSelectedItemPosition(-1);
1307 }
1308
1309 if (this.filter && (e.target as HTMLInputElement).value === "") {
1310 this.open = false;
1311 }
1312
1313 this.isTyping = true;
1314 }
1315
1316 _startsWithMatchingItems(str: string): Array<IInputSuggestionItemSelectable> {
1317 return Filters.StartsWith(str, this._selectableItems, "text");

Callers 2

_handleInputMethod · 0.95
_handleNativeInputMethod · 0.95

Calls 3

getInputDOMRefSyncMethod · 0.95
fireEventByActionMethod · 0.95

Tested by

no test coverage detected