diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md index b74b36c439286..a57da72d8c9d4 100644 --- a/actionview/CHANGELOG.md +++ b/actionview/CHANGELOG.md @@ -1,3 +1,9 @@ +* Use `display:none` instead of `display:inline` for hidden fields + + Fixes #6403 + + *Gaelian Ditchburn* + * The `video_tag` helper accepts a number as `:size` The `:size` option of the `video_tag` helper now can be specified diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index b6b00df0a0187..5235962f9f367 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -51,7 +51,7 @@ module Helpers # The HTML generated for this would be (modulus formatting): # #
- #
+ #
# #
# : @@ -81,7 +81,7 @@ module Helpers # the code above as is would yield instead: # # - #
+ #
# # #
@@ -315,7 +315,7 @@ module FormHelper # The HTML generated for this would be: # # - #
+ #
# #
# ... @@ -333,7 +333,7 @@ module FormHelper # The HTML generated for this would be: # # - #
+ #
# #
# ... diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 7ceb56625fea5..80f066b3bebc4 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -722,7 +722,7 @@ def extra_tags_for_form(html_options) enforce_utf8 = html_options.delete("enforce_utf8") { true } tags = (enforce_utf8 ? utf8_enforcer_tag : ''.html_safe) << method_tag - content_tag(:div, tags, :style => 'margin:0;padding:0;display:inline') + content_tag(:div, tags, :style => 'display:none') end def form_tag_html(html_options) diff --git a/actionview/test/activerecord/form_helper_activerecord_test.rb b/actionview/test/activerecord/form_helper_activerecord_test.rb index 2e302c65a7269..0a9628da8d156 100644 --- a/actionview/test/activerecord/form_helper_activerecord_test.rb +++ b/actionview/test/activerecord/form_helper_activerecord_test.rb @@ -59,7 +59,7 @@ def test_nested_fields_for_with_child_index_option_override_on_a_nested_attribut protected def hidden_fields(method = nil) - txt = %{
} + txt = %{
} txt << %{} if method && !%w(get post).include?(method.to_s) txt << %{} diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb index 90f7a412fbb04..fe82349265924 100644 --- a/actionview/test/template/form_helper_test.rb +++ b/actionview/test/template/form_helper_test.rb @@ -3023,7 +3023,7 @@ def test_form_for_only_instantiates_builder_once protected def hidden_fields(method = nil) - txt = %{
} + txt = %{
} txt << %{} if method && !%w(get post).include?(method.to_s) txt << %{} diff --git a/actionview/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb index 22bf438a56423..0d5831dc6f134 100644 --- a/actionview/test/template/form_tag_helper_test.rb +++ b/actionview/test/template/form_tag_helper_test.rb @@ -14,7 +14,7 @@ def hidden_fields(options = {}) method = options[:method] enforce_utf8 = options.fetch(:enforce_utf8, true) - txt = %{
} + txt = %{
} txt << %{} if enforce_utf8 if method && !%w(get post).include?(method.to_s) txt << %{}