From c0a6bf54fc14a6fd82e41726e8c58bb91b8c0ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 27 Jul 2021 23:42:52 +0200 Subject: [PATCH] Fix invisible error message in attachments In commit cc6f9391f we made the images and documents file inputs invisible (instead of using `display: none`) in order to make it possible to attach images and documents using the keyboard. However, since the error messages associated to these inputs has the same HTML class as the inputs, we were also hiding them (the `display: none` didn't affect the error messages because they've also got the `is-visible` class). Using the `[type=file]` selector we make it more explicit that we only want to style these inputs. I'm not adding a test for this scenario because technically the text is there and I'm not sure how to test for the presence of invisible elements. --- app/assets/stylesheets/mixins/uploads.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/stylesheets/mixins/uploads.scss b/app/assets/stylesheets/mixins/uploads.scss index 570b65326..692ec9b05 100644 --- a/app/assets/stylesheets/mixins/uploads.scss +++ b/app/assets/stylesheets/mixins/uploads.scss @@ -28,8 +28,7 @@ .attachment-errors { - > .js-image-attachment, - > .js-document-attachment { + > [type=file] { @include element-invisible; ~ .error {