mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-13 19:30:36 -05:00
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:
committed by
Dhruwang
parent
0df5e26381
commit
17d31c9fb1
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user