fix display of labels for datetime on screenreaders

This commit is contained in:
clemkeirua 2020-07-20 10:46:09 +02:00
parent bc34905742
commit c0cf8b1341
3 changed files with 19 additions and 5 deletions

View file

@ -25,7 +25,7 @@ module ActionView
end
field_for = "#{prefix.join('_')}_#{@options[:field_name]}"
"<span class='hidden'><label for='#{field_for}_#{n}i'>#{label}</label></span>"
"<label class='screen-reader-text' for='#{field_for}_#{n}i'>#{label}</label>"
end
# Returns the separator for a given datetime component.