1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

Ensure the condition group "Add condition" button is type button to avoid form submission

This commit is contained in:
hatz 2025-05-09 19:44:21 -05:00
parent f92c4d62a4
commit 8926aa2171
No known key found for this signature in database
2 changed files with 2 additions and 1 deletions

View file

@ -48,6 +48,7 @@
text: "Add condition",
leading_icon: "plus",
variant: "ghost",
type: "button",
data: { action: "rule--conditions#addSubCondition" }
) %>
</li>

View file

@ -12,7 +12,7 @@
<section class="space-y-4">
<h3 class="text-sm font-medium text-primary">If <%= rule.resource_type %></h3>
<%# Condition template, used by Stimulus controller to add new conditions dynamically %>
<%# Condition Group template, used by Stimulus controller to add new conditions dynamically %>
<template data-rules-target="conditionGroupTemplate">
<%= f.fields_for :conditions, Rule::Condition.new(rule: rule, condition_type: "compound", operator: "and"), child_index: "IDX_PLACEHOLDER" do |cf| %>
<%= render "rule/conditions/condition_group", form: cf %>