Skip to content

Commit c6564f9

Browse files
committed
use html5 min/max on input field for config'd min/max
1 parent 85a06b0 commit c6564f9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

app/components/blacklight_range_limit/range_form_component.html.erb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,22 @@
55
<div class="d-flex justify-content-between align-items-end">
66
<div class="d-flex flex-column mr-1 me-1">
77
<%= label_tag(begin_input_name, t("blacklight.range_limit.range_begin_short"), class: 'text-muted small mb-1') %>
8-
<%= number_field_tag(begin_input_name, begin_value_default, class: "form-control form-control-sm range_begin") %>
8+
<%= number_field_tag(begin_input_name,
9+
begin_value_default,
10+
min: range_config[:min_value],
11+
max: range_config[:max_value],
12+
class: "form-control form-control-sm range_begin")
13+
%>
914
</div>
1015

1116
<div class="d-flex flex-column ml-1 ms-1">
1217
<%= label_tag(end_input_name, t("blacklight.range_limit.range_end_short"), class: 'text-muted small mb-1') %>
13-
<%= number_field_tag(end_input_name, end_value_default, class: "form-control form-control-sm range_end") %>
18+
<%= number_field_tag(end_input_name,
19+
end_value_default,
20+
min: range_config[:min_value],
21+
max: range_config[:max_value],
22+
class: "form-control form-control-sm range_end")
23+
%>
1424
</div>
1525
</div>
1626
<div class="d-flex justify-content-end mt-2">

0 commit comments

Comments
 (0)