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

Can't use post publish dropdown with a screen reader #11868

Closed
ndarilek opened this issue May 30, 2020 · 20 comments
Closed

Can't use post publish dropdown with a screen reader #11868

ndarilek opened this issue May 30, 2020 · 20 comments
Labels
affects:admin Anything relating to Ghost Admin help wanted [triage] Ideal issues for contributors to help with stale [triage] Issues that were closed to to lack of traction

Comments

@ndarilek
Copy link

Hello,

I'm a screen reader user, and have occasionally tried and failed to use Ghost. My blocker is the button for setting a post's publication status. This control has the following issues:

  1. It is apparently a dropdown, but only reports as a button. You may want to use aria-expanded here.
  2. When clicked/expanded, none of the child elements are focusable, or keyboard-interactable in any way.
  3. I'm using Orca under Linux, and even using its mouse emulation mode, I can't seem to click on any of the publication options.

I looked at the code but am not overly familiar with Ember, so I'm wondering if this would be a quicker fix for someone with that knowledge? In particular, it looks like you may be using a basic-dropdown component, but I'm not clear if that ships with core Ember/a third party dependency, and if it gives you the flexibility you need to fix this.

The quickest fix would likely just be making the dropdown elements <button/> so you'd get accessibility for free. The second quickest would likely be slapping role="button" on whatever elements you do use, setting tabindex="0", and adding key handlers for space/enter. If you use this pattern lots, make that a component for reuse.

If someone were to start a PR, I'm happy to test it. But a PR would also show me what specifically to change, so I can probably iterate on it myself and fix any remaining issues. But, chances are that if you can tab/arrow to the publication states and activate them via the keyboard, then things will just work.

In the meantime, is there any other way to tweak publication state other than spelunking in the database? :)

Thanks.

@MarcoZehe
Copy link
Contributor

I fixed this issue with aria-expanded not being set when the dropdown is collapsed, in cibernox/ember-basic-dropdown#556. Once a new version is released and the package updated in the Ghost Admin client, this fix will automatically propagate.

However, the other problem is that the children of the dropdown are being aria-owned into the button element. So they become children of the button on the accessibility tree side. NVDA deals with this okay‘ish, VoiceOver, too. But Orca seems to be less forgiving. The problem is that, if this wasn‘t the case, the new content would be far far away from the actual button DOM-wise. Not sure how to solve that in the basic-dropdown component, which is where this fix must happen.

@ndarilek
Copy link
Author

ndarilek commented May 30, 2020 via email

@ndarilek
Copy link
Author

ndarilek commented May 31, 2020 via email

@MarcoZehe
Copy link
Contributor

@ndarilek I think I fixed it. Can you try this preview? It opens a set of unlabeled buttons from the top navigation bar, but if you call up Docs, then How To Use, there are more there that show some more useful content when expanded.

@ndarilek
Copy link
Author

ndarilek commented May 31, 2020 via email

@MarcoZehe
Copy link
Contributor

  1. When I attempt activating the dropdown with Enter, I hear "Collapsed: collapsed." I realize that isn't exactly what I reported, but if you're patching this dependency, would it be possible to address that as well? Space works fine. Not sure whether that specific behavior is part of the component itself, or if the markup representing the collapsed item is separate and not directly owned by the component.

It is, but it is a separate issue. Enter is merely being passed through, and the event for some reason fires twice. Space is handled differently, its propagation is being stopped, so it only fires once. I will file a new issue and correct that so that Enter and Space always behave the same.

  1. The buttons don't appear to receive keyboard focus. Again, not sure if that is specific to the dropdown component, or if the markup you used in your example just doesn't add the tabindexes. If the latter, it should be easy enough to add them in Ghost itself. Thanks for the fixes!

It is not my example actualy. It's provided by the original author, I'm just patching things. The reason is because in the DOM order, these items are appended to the end of the document. So simply tabbing forward doesn't go to these initially, but will land on them eventually. This is the thing with aria-owns, it changes the accessibility tree, but not the DOM order, so keyboard focus sometimes acts a bit odd. Having said that, these examples have a separate bug in that the items are always appended at the end, not the place the component actually specifies where they should be added. But I am not sure why, and am not so keen on fixing that part TBH.

@ndarilek
Copy link
Author

ndarilek commented Jun 1, 2020 via email

@ErisDS
Copy link
Member

ErisDS commented Jun 1, 2020

I don't want to hijack this issue, but are there any alternative ways of
publishing to Ghost?

Just to quickly talk about workarounds - there are lots of ways to publish without using Ghost Admin. At its heart, Ghost is just an API, and Ghost Admin is the default client. You can use a 3rd party client or write your own client just to do what you need.

There are many 3rd party clients listed on our integrations page such as Ulysses or iAWriter.

If you want to write your own work around, documentation for our Admin API client lives here: https://ghost.org/docs/api/v3/javascript/admin/ and documentation for how to update a post lives here: https://ghost.org/docs/api/v3/admin/#updating-a-post. With the API client, it shouldn't take more than 10 lines of code to grab a post by ID or slug, and update the status to published.

@ndarilek
Copy link
Author

ndarilek commented Jun 1, 2020 via email

@ndarilek
Copy link
Author

ndarilek commented Jun 1, 2020 via email

kevinansfield added a commit to TryGhost/Admin that referenced this issue Jun 2, 2020
refs TryGhost/Ghost#11868

- includes bump of `ember-basic-dropdown` that contains accessibility improvements
@kevinansfield
Copy link
Contributor

I fixed this issue with aria-expanded not being set when the dropdown is collapsed, in cibernox/ember-basic-dropdown#556. Once a new version is released and the package updated in the Ghost Admin client, this fix will automatically propagate.

I've forced an update of Ghost-Admin's sub-dependencies so the ember-basic-dropdown upgrade will go out in today's release 🙂

@ErisDS
Copy link
Member

ErisDS commented Jun 2, 2020

I'm not sure if there's a Save button somewhere in this dropdown that I
can't find, or if there's another inaccessible control I can't find at
all. Happy to open a new issue--the challenge is that I don't know
enough to determine whether this is related or not. :)

It is definitely the same problem - the same pattern used for publishing is reused for updating. There's an update dropdown, which (same as the publish dropdown) has 2 radio buttons that let you toggle between unpublishing or keeping the post published (keeping it published is the second, but default option) and then there's an "update" button.

To be honest I never use this workflow, I always use cmd / ctrl + s. I don't know if that helps.

It's not helpful immediately, but these workflows and interfaces are due an overhaul later this year as it's not lost on us we've outgrown them.

@ndarilek
Copy link
Author

ndarilek commented Jun 2, 2020 via email

@ErisDS
Copy link
Member

ErisDS commented Jun 2, 2020

By default we try to make sure the keyboard behaves as you'd expect, so save, undo, redo, select all, backspace/delete should all behave naturally. Ghost aims to not trip you up when you are writing.

All common formatting shortcuts like bold and italic are also in place, plus a few extended ones and these are documented here:

https://ghost.org/faq/using-the-editor/#markdown-reference

We're missing documentation for shortcuts not related to formatting and I had thought that was because we only supported obvious ones, and all our custom shortcuts for things like publishing had been removed because they tend to cause conflicts with various keyboard layouts for other languages.

However, I have just done a test and cmd-shift-p does in fact publish the post. It also updates an already published post. cmd-s will save a draft post, and also update an already published post. You should be able to swap cmd for ctrl on linux and this should be a viable workaround for this issue for now 🎉

We need to review our shortcuts and document the remaining handful of custom ones we have that are genuinely useful and making them easy to find.

As for GitHub vs forum, with these issues it's a tricky line. If there are genuine usability problems that we aren't aware of, GitHub is fine for these especially if as in these cases there are people willing and able to contribute solutions. In this case it was also extra fun because I'm not sure anyone even realised we still had a publish shortcut - I wouldn't have suggested the API if I had realised 🙈

@ndarilek
Copy link
Author

ndarilek commented Jun 2, 2020 via email

@ErisDS
Copy link
Member

ErisDS commented Jun 12, 2020

Did the ember-basic-dropdown upgrade help with this?

@ndarilek
Copy link
Author

ndarilek commented Jun 12, 2020 via email

@ErisDS ErisDS added affects:admin Anything relating to Ghost Admin help wanted [triage] Ideal issues for contributors to help with labels Aug 3, 2020
@stale
Copy link

stale bot commented Nov 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale [triage] Issues that were closed to to lack of traction label Nov 2, 2020
@matthanley matthanley added the pinned [triage] Ignored by stalebot label Nov 2, 2020
@stale stale bot removed the stale [triage] Issues that were closed to to lack of traction label Nov 2, 2020
@MarcoZehe
Copy link
Contributor

This issue is still present in current Ghost and requires a PR to an upstream component that I submitted in May, be merged.

@ErisDS ErisDS removed the pinned [triage] Ignored by stalebot label Feb 1, 2021
@stale
Copy link

stale bot commented Jun 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale [triage] Issues that were closed to to lack of traction label Jun 9, 2021
@stale stale bot closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin help wanted [triage] Ideal issues for contributors to help with stale [triage] Issues that were closed to to lack of traction
Projects
None yet
Development

No branches or pull requests

5 participants