fix(conditional): change number input to text input, to display original text not empty in the error message

This commit is contained in:
simon lehericey 2022-09-14 16:28:00 +02:00
parent f53e8608ae
commit eb71207457
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
@import "colors"; @import "colors";
@import "constants"; @import "constants";
.conditionnel { form.form > .conditionnel {
.condition-error { .condition-error {
background: $background-red; background: $background-red;
@ -64,7 +64,7 @@
margin-bottom: 0; margin-bottom: 0;
} }
input[type=number] { input[type=text] {
display: inline-block; display: inline-block;
margin-bottom: 0; margin-bottom: 0;
} }

View file

@ -169,7 +169,7 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent
class: { alert: right_invalid } class: { alert: right_invalid }
) )
when :number when :number
number_field_tag( text_field_tag(
input_name_for('value'), input_name_for('value'),
right.value, right.value,
required: true, required: true,
@ -177,7 +177,7 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent
class: { alert: right_invalid } class: { alert: right_invalid }
) )
else else
number_field_tag(input_name_for('value'), '', id: input_id_for('value', row_index)) text_field_tag(input_name_for('value'), '', id: input_id_for('value', row_index))
end end
end end