Skip to content

Commit 8bcf85f

Browse files
authored
fix(ui5-input): update typedInValue upon clear (#11882)
FIXES: #11836
1 parent 4e1b019 commit 8bcf85f

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

packages/main/cypress/specs/Input.cy.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,30 @@ describe("Input general interaction", () => {
419419

420420
cy.get("@inputEvent").should("have.been.calledTwice");
421421
});
422+
423+
it("Should updated typedInValue upon clear", () => {
424+
cy.mount(
425+
<Input showClearIcon></Input>
426+
);
427+
428+
cy.get("[ui5-input]")
429+
.as("input")
430+
.realClick();
431+
432+
cy.get("@input")
433+
.realType("C");
434+
435+
// click on the clear icon
436+
cy.get("@input")
437+
.shadow()
438+
.find("[ui5-icon]")
439+
.as("clearIcon")
440+
.realClick();
441+
442+
// check typedInValue property
443+
cy.get("@input")
444+
.should("have.prop", "typedInValue", "");
445+
});
422446
});
423447

424448
describe("Input arrow navigation", () => {

packages/main/src/Input.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,8 @@ class Input extends UI5Element implements SuggestionComponent, IFormInputElement
11761176
return;
11771177
}
11781178

1179+
this.typedInValue = "";
1180+
11791181
if (!this._isPhone) {
11801182
this.fireResetSelectionChange();
11811183
this.focus();

0 commit comments

Comments
 (0)