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

View file

@ -169,7 +169,7 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent
class: { alert: right_invalid }
)
when :number
number_field_tag(
text_field_tag(
input_name_for('value'),
right.value,
required: true,
@ -177,7 +177,7 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent
class: { alert: right_invalid }
)
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