Change the "Add condition" button in groups to type button to avoid form submission #2233
@@ -44,6 +44,7 @@
|
||||
text: "Add condition",
|
||||
leading_icon: "plus",
|
||||
variant: "ghost",
|
||||
type: "button",
|
||||
data: { action: "rule--conditions#addSubCondition" }
|
||||
) %>
|
||||
</li>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user