From 17d31c9fb1e7962bc7416266a569ec604a67ec2d Mon Sep 17 00:00:00 2001 From: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:09:42 +0530 Subject: [PATCH] fix: clear validation settings when disabling open text validation (#7464) Co-authored-by: Claude Sonnet 4.6 --- .../editor/components/validation-rules-editor.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/web/modules/survey/editor/components/validation-rules-editor.tsx b/apps/web/modules/survey/editor/components/validation-rules-editor.tsx index 101b26e597..74ee021de2 100644 --- a/apps/web/modules/survey/editor/components/validation-rules-editor.tsx +++ b/apps/web/modules/survey/editor/components/validation-rules-editor.tsx @@ -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) => {