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: make prev and next slides not focusable and aria-hidden #2091

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Dec 1, 2023

Resolves

Because of 6d4e7cd the previous and the next slides are rendered and only visually hidden. It makes elements on them focusable and visible for a screen reader.

The previous and the next slide should be inert and hidden.

Notes

Because of forced mixin with inheritAttrs: force, it is not possible to pass attributs on the file content element, e.g. <img> in <Images>.

export default {
inheritAttrs: false,

So a new wrapper element had to be added.

By the way, it was incredibly hard to find, why attributes doesn't work on components even there is no inheritAttrs, no local or global mixins. A mixin is added in runtime, mutating a component definition 🥲

viewer/src/views/Viewer.vue

Lines 824 to 825 in ea8f76a

// force apply mixin
handler.component.mixins = [...handler?.component?.mixins ?? [], Mime]

Also, in 6b46c8a common hidden-visually class was replaced with a custom viewer__file--hidden. I keep it as it is, but I don't understand it. @skjnldsv Do you member why a custom class was required here? How it fixes click outside?

Screenshots

🏚️ Before 🏡 After
Focus is lost (see log) Only the current slide is focusable
viewer-focus-before viewer-focus-after
Screen reader sees the image on the next slide Only the current image is visible
viewer-screen-reader-before viewer-screen-reader-after

No visual changes in other viewers:

image

@ShGKme ShGKme added bug Something isn't working 2. developing Work in progress accessibility labels Dec 1, 2023
@ShGKme ShGKme added this to the Nextcloud 29 milestone Dec 1, 2023
@ShGKme ShGKme self-assigned this Dec 1, 2023
@ShGKme ShGKme force-pushed the fix/a11y-remove-focus-on-prev-next-slides branch from d057cad to a9d1cda Compare January 3, 2024 21:09
But it doesn't work on a video slide, as it re-mounts the container and loses attributes.

Signed-off-by: Grigorii K. Shartsev <[email protected]>
@ShGKme ShGKme added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 4, 2024
@ShGKme ShGKme force-pushed the fix/a11y-remove-focus-on-prev-next-slides branch from a9d1cda to db36b23 Compare January 4, 2024 19:14
@ShGKme
Copy link
Contributor Author

ShGKme commented Jan 4, 2024

/backport to stable28

@ShGKme ShGKme marked this pull request as ready for review January 4, 2024 19:14
@backportbot-nextcloud backportbot-nextcloud bot added the backport-request Pending backport by the backport-bot label Jan 4, 2024
Copy link
Member

@Pytal Pytal left a comment

Choose a reason for hiding this comment

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

Code looks good and works with NVDA!

@ShGKme
Copy link
Contributor Author

ShGKme commented Jan 4, 2024

Added a test, but wasn't sure where to put it

@ShGKme
Copy link
Contributor Author

ShGKme commented Jan 4, 2024

build check makes me crazy... I didn't change anything to the build, only added a test. Now it considers assets invalid...

@ShGKme ShGKme force-pushed the fix/a11y-remove-focus-on-prev-next-slides branch from 01d8ccf to 34688e0 Compare January 4, 2024 20:41
@ShGKme
Copy link
Contributor Author

ShGKme commented Jan 4, 2024

/compile amend

Signed-off-by: Grigorii K. Shartsev <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
@nextcloud-command nextcloud-command force-pushed the fix/a11y-remove-focus-on-prev-next-slides branch from 34688e0 to 942f0a6 Compare January 4, 2024 20:43
@skjnldsv skjnldsv merged commit 7482fb4 into master Jan 5, 2024
33 checks passed
@skjnldsv skjnldsv deleted the fix/a11y-remove-focus-on-prev-next-slides branch January 5, 2024 10:54
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jan 5, 2024
@backportbot-nextcloud

This comment was marked as resolved.

@skjnldsv
Copy link
Member

skjnldsv commented Jan 5, 2024

/backport 36baffb to stable28

@skjnldsv
Copy link
Member

skjnldsv commented Jan 5, 2024

/backport 6998c9c to stable28

@backportbot-nextcloud
Copy link

The backport to stable28 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable28
git pull origin stable28

# Create the new backport branch
git checkout -b fix/foo-stable28

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable28

Error: Unknown error

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@skjnldsv
Copy link
Member

skjnldsv commented Jan 5, 2024

/backport 6998c9c to backport-2091-stable28

@backportbot-nextcloud backportbot-nextcloud bot added the backport-request Pending backport by the backport-bot label Jan 5, 2024
@skjnldsv
Copy link
Member

skjnldsv commented Jan 5, 2024

(trying something 🙈 )

@ShGKme
Copy link
Contributor Author

ShGKme commented Jan 5, 2024

The question in the description is still interesting to me =D

@skjnldsv
Copy link
Member

skjnldsv commented Jan 5, 2024

The question in the description is still interesting to me =D

image
🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish accessibility bug Something isn't working
Projects
None yet
4 participants