Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use proper way of hiding the attachment input #5230

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

juliushaertl
Copy link
Member

Hide the input field properly to make it not focusable and hidden for assistive technologies.

as described in #5224 (comment)

@juliushaertl
Copy link
Member Author

/backport to stable28

<input ref="attachmentFileInput"
tabindex="-1"
<input v-show="false"
ref="attachmentFileInput"
data-text-el="attachment-file-input"
type="file"
accept="*/*"
aria-hidden="true"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShGKme Also do we still need the aria-hidden then or is this already fine with just having display: none; through v-show

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, display: none (and visibility: hidden) both make element completely hidden.

Let's say, be default element is visible for both monitor's and screen reader's users.

  • display: none/visibility: hidden - hides element completely for everything
  • aria-hidden="true" - hides element only for screen readers (meaning, it is not important element, like decorative image)
  • hidden-visually - hides element only visually (meaning, this is only for screen reader or replaces some only visual element)

One specific case when aria-hidden="true" and hidden-visually used together - the prev and next slides in Viewer. They must be hidden, but for image/video pre-loading and because of a bug in FF we need then to not be display: none.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that makes sense ❤️

@juliushaertl juliushaertl merged commit 18a1811 into main Jan 11, 2024
52 checks passed
@juliushaertl juliushaertl deleted the bugfix/noid/a11y-input-file branch January 11, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants