Synchronize percentage for new progress bars
According to the HTML specification: > The default value is the minimum plus half the difference between the > minimum and the maximum, unless the maximum is less than the minimum, > in which case the default value is the minimum. So for new progress bars, we had a numeric value of `nil` and a range value of `50`, meaning the input fields weren't in sync. Manually triggering the event on the progress, while not an ideal solution (ideally we would be able to define `0` as default), sets the value of the numeric field.
This commit is contained in:
@@ -28,6 +28,8 @@ App.Forms =
|
||||
input: ->
|
||||
$("[name='#{this.name}']").val($(this).val())
|
||||
|
||||
$("[name='progress_bar[percentage]'][type='range']").trigger("input")
|
||||
|
||||
hideOrShowFieldsAfterSelection: ->
|
||||
$("[name='progress_bar[kind]']").on
|
||||
change: ->
|
||||
|
||||
Reference in New Issue
Block a user