fix: clear validation settings when disabling open text validation (#7464)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Dhruwang Jariwala
2026-03-13 15:09:42 +05:30
committed by GitHub
parent 0df5e26381
commit 75f44952c7

View File

@@ -94,6 +94,17 @@ export const ValidationRulesEditor = ({
const handleDisable = () => {
onUpdateValidation({ rules: [], logic: validationLogic });
// Reset inputType to "text" when disabling validation for OpenText elements.
// Without this, the HTML input keeps its type (e.g. "url"), which still enforces
// browser-native format validation even though the user toggled validation off.
if (
elementType === TSurveyElementTypeEnum.OpenText &&
onUpdateInputType &&
inputType !== undefined &&
inputType !== "text"
) {
onUpdateInputType("text");
}
};
const handleAddRule = (insertAfterIndex: number) => {