Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ describe(

agHelper.ClearNType(locators._input, "100");
agHelper.ValidateToastMessage("Value Changed");
agHelper.WaitUntilToastDisappear("Value Changed");
agHelper.ClearNType(locators._input, "a");
cy.get(locators._toastMsg).should("not.exist");

// onFocus
propPane.SelectPlatformFunction("onFocus", "Show alert");
Expand Down
19 changes: 12 additions & 7 deletions app/client/src/widgets/PhoneInputWidget/widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,18 @@ class PhoneInputWidget extends BaseInputWidget<
"value",
parseIncompletePhoneNumber(formattedValue),
);
this.props.updateWidgetMetaProperty("text", formattedValue, {
triggerPropertyName: "onTextChanged",
dynamicString: this.props.onTextChanged,
event: {
type: EventType.ON_TEXT_CHANGE,
},
});
// This regular expression validates that the input:
// - Does not start with a whitespace character
// - Contains only digits, spaces, parentheses, plus, and minus symbols
if (/^(?!\s)[\d\s()+-]*$/.test(value)) {
this.props.updateWidgetMetaProperty("text", formattedValue, {
triggerPropertyName: "onTextChanged",
dynamicString: this.props.onTextChanged,
event: {
type: EventType.ON_TEXT_CHANGE,
},
});
}
if (!this.props.isDirty) {
this.props.updateWidgetMetaProperty("isDirty", true);
}
Expand Down