-
Notifications
You must be signed in to change notification settings - Fork 29
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
New: Add option to make entire menu items clickable (fixes #157) #188
Conversation
Ok, after seeing this in action, I will close this issue and PR. The main problem I'm seeing is that you would have to add all of the menu item information to the same aria label (title, body, duration, all the statuses, etc.), which can make it excessively long and complex. With the View button, a screenreader user can tab through each element one at a time so as to not be overwhelmed with information. The body text is the real killer since it can be much longer than a typical title. I think this could still work, but, yeah, probably better as a completely new menu plugin. Navigating through thumbnails on Hulu could be closer to what we actually would want since you can navigate to elements within each thumbnail. |
I'm not sure it has to all go in an aria-label. If you follow the a tag examples (
Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#technical_summary Just need to pay attention to how it reads with a screen reader. |
Ok, maybe I'll keep tinkering with this one. |
Co-authored-by: Oliver Foster <[email protected]>
@oliverfoster Do you have any idea why the skip navigation focus bug is happening (see details above under "To-do (bug fix)")? Bug: When |
Yeas, I have a theory. It's that a This is roughly how the browser and Adapt's accessibility stuff determines what is focusable: https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Keyboard |
Thanks, @oliverfoster . Adding a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a much smaller change than it appeared originally. What does everyone think?
@@ -106,6 +106,8 @@ The first value is the horizontal position and the second value is the vertical. | |||
|
|||
>>>**\_small** (number): The minimum height should only be used in instances where the menu header height needs to be greater than the content e.g. to prevent a background image being cropped. | |||
|
|||
>>>**\_areEntireItemsClickable** (boolean): Indicates if the entire menu item can be clicked to go to the target page. If `true`, the View button will be hidden. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't like this setting name. I have feelsies it should be something like "_useTilesNotButtons"
or "_useTiles"
but I can't quite put my finger on it. I don't suppose it matters that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not committed to this setting name. Could even be as simple as _hideItemButtons
or _hasItemButtons
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used _boxMenuItemIsClickable
when doing similar on projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirsty-hames @oliverfoster I like _boxMenuItemIsClickable
. Shall I change it to that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No other property in box menu is prefixed with _boxMenu
.
Summary:
The behaviour hides the button and makes the item clickable. It is a layout alteration. The proposed names so far only describe either removing the button or making the item clickable, not both, which is more important? Is there another concept that encapsulates both changes? We haven't provided a rationale as to why one would enable/disable this property and choose the layout change.
Suggestion:
_isItemClickable
perhaps? To keep it simple.
Hey @swashbuck, I was giving this an accessibility test and I'm unable to enter a menu item using keyboard controls. I tested this across Mac Safari, Chrome and FF doing the following:
I'm unable to test if this is the case for Windows too. I'm assuming this is down to the
Thoughts on doing something similar to above? |
Personally, I'm not really that keen on the change. Adapt has generally been moving towards having clickable elements to buttons to give consistent identification, visual and non visual end users, and to create a consistent approach for development. This change adds a click functionality to the In order for the change to not be counter to the previous examples we'd need to convert the Example of previous conversion work: The required changes to achieve the desired outcome, personally, will combine to make a more time consuming and complicated template to maintain. I do maintain that I think this feature is better suited as a separate plugin. |
@kirsty-hames The issue was that the only event was a Will you retest to see if this resolves the issue? |
Thanks for your opinion, @guywillis . I would argue that we do not necessarily need to use semantic elements like |
Thanks @swashbuck. I've retested this and the focus is now trapped on the first menu item. This is also the case when |
Co-authored-by: Oliver Foster <[email protected]>
Summary so farArguments against
Arguments for
Points of note
The alternative to this pr would beTo have a separate menu, based on this one, for a specific graphic/tile styles with the possibility for defined/further layout options and innate styling @swashbuck |
This PR will now need updates to boxMenuItem.jsx now that the JSX conversion is complete. |
I agree with Ollie, I'd much prefer these to be proper HTML buttons with span tags inside the button. I also agree that it would make the PR a little too complicated as I think it's a really good idea to keep the boxmenu simple. Happy to have a separate menu with this type of functionality. |
Closing as no resolution found. |
Fixes #157
New
_areEntireItemsClickable
option to make entire menu items clickabletrue
Testing
_areEntireItemsClickable
option to the_boxMenu
object in course.json.Screenshots