Skip to content

Commit

Permalink
Fix invisible error message in attachments
Browse files Browse the repository at this point in the history
In commit cc6f939 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.
  • Loading branch information
javierm committed Jul 27, 2021
1 parent 6c63aae commit c0a6bf5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/assets/stylesheets/mixins/uploads.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@

.attachment-errors {

> .js-image-attachment,
> .js-document-attachment {
> [type=file] {
@include element-invisible;

~ .error {
Expand Down

0 comments on commit c0a6bf5

Please sign in to comment.