Make expandable table rows accessible
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am creating a React component for tables with expandable rows, and I want to make it as accessible as possible.
Here's a simple, unstyled example of what I'm making:
https://codesandbox.io/s/nz8r2w74j
Whenever I click the "more info" button, a new row is added, with info about the row in front of it.
What do I need to add in terms of wai-aria roles, focus management and other stuff in order to make it truly accessible?
html reactjs accessibility wai-aria
add a comment |
I am creating a React component for tables with expandable rows, and I want to make it as accessible as possible.
Here's a simple, unstyled example of what I'm making:
https://codesandbox.io/s/nz8r2w74j
Whenever I click the "more info" button, a new row is added, with info about the row in front of it.
What do I need to add in terms of wai-aria roles, focus management and other stuff in order to make it truly accessible?
html reactjs accessibility wai-aria
I'm sorry, what's with the downvote?
– Kris Selbekk
Nov 15 '18 at 12:33
1
not sure, wasn't me
– slugolicious
Nov 15 '18 at 15:53
add a comment |
I am creating a React component for tables with expandable rows, and I want to make it as accessible as possible.
Here's a simple, unstyled example of what I'm making:
https://codesandbox.io/s/nz8r2w74j
Whenever I click the "more info" button, a new row is added, with info about the row in front of it.
What do I need to add in terms of wai-aria roles, focus management and other stuff in order to make it truly accessible?
html reactjs accessibility wai-aria
I am creating a React component for tables with expandable rows, and I want to make it as accessible as possible.
Here's a simple, unstyled example of what I'm making:
https://codesandbox.io/s/nz8r2w74j
Whenever I click the "more info" button, a new row is added, with info about the row in front of it.
What do I need to add in terms of wai-aria roles, focus management and other stuff in order to make it truly accessible?
html reactjs accessibility wai-aria
html reactjs accessibility wai-aria
asked Nov 15 '18 at 7:54
Kris SelbekkKris Selbekk
3,68233053
3,68233053
I'm sorry, what's with the downvote?
– Kris Selbekk
Nov 15 '18 at 12:33
1
not sure, wasn't me
– slugolicious
Nov 15 '18 at 15:53
add a comment |
I'm sorry, what's with the downvote?
– Kris Selbekk
Nov 15 '18 at 12:33
1
not sure, wasn't me
– slugolicious
Nov 15 '18 at 15:53
I'm sorry, what's with the downvote?
– Kris Selbekk
Nov 15 '18 at 12:33
I'm sorry, what's with the downvote?
– Kris Selbekk
Nov 15 '18 at 12:33
1
1
not sure, wasn't me
– slugolicious
Nov 15 '18 at 15:53
not sure, wasn't me
– slugolicious
Nov 15 '18 at 15:53
add a comment |
2 Answers
2
active
oldest
votes
You essentially have a "disclosure widget". The button that opens/closes the section would have aria-expanded
set to true/false.
However, I would not literally add a new row to the table because that might confuse screen readers. When the table is first navigated to, the user will hear the table has four rows (including the header) and four columns. When you click the "more info" button, the table will now have five rows but the screen reader is not going to tell the user that another row appeared. If the user was navigating down the column and hearing the row numbers (which are normally announced by screen readers), they'd end up on row five when earlier they heard there were only four rows in the table.
I don't know if this would work for your case, but in the demo code, the extra info is related to the person so it could just be hidden information (css display:none) that exists in the first table cell. When you select the button, the information is revealed (css display:block).
Also, you would either need to make the name a row header (<th scope="row">
) or you'd need to associate the person's name with the "more info" button so that the screen reader knows which person they're getting more info about.
I don't know react but the generated html would either look like this (with row headers):
<tr>
<th scope="row">Avicii</th>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button>More info</button>
</td>
</tr>
<tr>
<th scope="row">Kygo</th>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button>More info</button>
</td>
</tr>
or would look like this (with additional information associated with the button):
<span id="moreInfoID" class="sr-only">more info about </span>
...
<tr>
<td id="name1">Avicii</td>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button aria-labelledby="moreInfoID name1">More info</button>
</td>
</tr>
<tr>
<td id="name2">Kygo</td>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button aria-labelledby="moreInfoID name2">More info</button>
</td>
</tr>
The latter is a bit more work. I would recommend the first one.
(You can see info on the sr-only
class at What is sr-only in Bootstrap 3?).
Also, your example shows the new row added has tabindex="0"
. Since the new information is not an interactive object, it should not receive keyboard focus and shouldn't have tabindex.
Thanks! Especially about that row announcement stuff - I didn't know that! Unfortunately, this particular implementation need to be flexible enough for me not to know anything about the content. The expandable content might be related to the first column, or it might not. It also need to span the entire width of the table - which isn't going to work with placing the (potentially very complex) expandable content into the first column
– Kris Selbekk
Nov 15 '18 at 9:27
Yeah, I was kind of afraid of that but wanted to post my initial thoughts and also mention that dynamically adding a row to the table might be confusing for screen reader users. I was still thinking about a more general solution and was going to update my answer if I have time to come up with something.
– slugolicious
Nov 15 '18 at 15:56
Does the "more info" info have to be a row in the table? Can it be displayed as kind of a "mega" tooltip (which would essentially be a modal dialog)? Modal dialogs have their own accessibility challenges, but I can post some resources for that.
– slugolicious
Nov 15 '18 at 16:04
The only time I've seen a table grow dynamically is when rows are added to the bottom of the table, and that's because of a user interaction such as clicking on an "add row" type of button, so it was expected behavior that the table would grow.
– slugolicious
Nov 15 '18 at 16:19
The "more info" info can be whatever, really, but my particular use case is a data heavy workflow where a "pro user" consumes, alters and interacts with a lot of info at once. Triggering a modal could indeed work, but it would also stop the user from being able to look at several detail panels at once, for instance, or comparing one "more info" panel with several other summaries. Perhaps this is best done without a table at all?
– Kris Selbekk
Nov 16 '18 at 13:20
|
show 2 more comments
You could add aria-expanded="true"
to the button when the collapsible section is expanded. And if you have tabindex="0"
on the focusabled items in the table (whole table), you wouldn't worry about tab ordering.
I've updated the sandbox: https://codesandbox.io/s/k5pkj4wzw3
For further reading on accessible collapsible sections (read: expandables), I recommend this article: https://inclusive-components.design/collapsible-sections/
you have a small typo in your sandbox code. you have "ariaexpanded" instead of "aria-expanded"
– slugolicious
Nov 15 '18 at 9:07
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314689%2fmake-expandable-table-rows-accessible%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You essentially have a "disclosure widget". The button that opens/closes the section would have aria-expanded
set to true/false.
However, I would not literally add a new row to the table because that might confuse screen readers. When the table is first navigated to, the user will hear the table has four rows (including the header) and four columns. When you click the "more info" button, the table will now have five rows but the screen reader is not going to tell the user that another row appeared. If the user was navigating down the column and hearing the row numbers (which are normally announced by screen readers), they'd end up on row five when earlier they heard there were only four rows in the table.
I don't know if this would work for your case, but in the demo code, the extra info is related to the person so it could just be hidden information (css display:none) that exists in the first table cell. When you select the button, the information is revealed (css display:block).
Also, you would either need to make the name a row header (<th scope="row">
) or you'd need to associate the person's name with the "more info" button so that the screen reader knows which person they're getting more info about.
I don't know react but the generated html would either look like this (with row headers):
<tr>
<th scope="row">Avicii</th>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button>More info</button>
</td>
</tr>
<tr>
<th scope="row">Kygo</th>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button>More info</button>
</td>
</tr>
or would look like this (with additional information associated with the button):
<span id="moreInfoID" class="sr-only">more info about </span>
...
<tr>
<td id="name1">Avicii</td>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button aria-labelledby="moreInfoID name1">More info</button>
</td>
</tr>
<tr>
<td id="name2">Kygo</td>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button aria-labelledby="moreInfoID name2">More info</button>
</td>
</tr>
The latter is a bit more work. I would recommend the first one.
(You can see info on the sr-only
class at What is sr-only in Bootstrap 3?).
Also, your example shows the new row added has tabindex="0"
. Since the new information is not an interactive object, it should not receive keyboard focus and shouldn't have tabindex.
Thanks! Especially about that row announcement stuff - I didn't know that! Unfortunately, this particular implementation need to be flexible enough for me not to know anything about the content. The expandable content might be related to the first column, or it might not. It also need to span the entire width of the table - which isn't going to work with placing the (potentially very complex) expandable content into the first column
– Kris Selbekk
Nov 15 '18 at 9:27
Yeah, I was kind of afraid of that but wanted to post my initial thoughts and also mention that dynamically adding a row to the table might be confusing for screen reader users. I was still thinking about a more general solution and was going to update my answer if I have time to come up with something.
– slugolicious
Nov 15 '18 at 15:56
Does the "more info" info have to be a row in the table? Can it be displayed as kind of a "mega" tooltip (which would essentially be a modal dialog)? Modal dialogs have their own accessibility challenges, but I can post some resources for that.
– slugolicious
Nov 15 '18 at 16:04
The only time I've seen a table grow dynamically is when rows are added to the bottom of the table, and that's because of a user interaction such as clicking on an "add row" type of button, so it was expected behavior that the table would grow.
– slugolicious
Nov 15 '18 at 16:19
The "more info" info can be whatever, really, but my particular use case is a data heavy workflow where a "pro user" consumes, alters and interacts with a lot of info at once. Triggering a modal could indeed work, but it would also stop the user from being able to look at several detail panels at once, for instance, or comparing one "more info" panel with several other summaries. Perhaps this is best done without a table at all?
– Kris Selbekk
Nov 16 '18 at 13:20
|
show 2 more comments
You essentially have a "disclosure widget". The button that opens/closes the section would have aria-expanded
set to true/false.
However, I would not literally add a new row to the table because that might confuse screen readers. When the table is first navigated to, the user will hear the table has four rows (including the header) and four columns. When you click the "more info" button, the table will now have five rows but the screen reader is not going to tell the user that another row appeared. If the user was navigating down the column and hearing the row numbers (which are normally announced by screen readers), they'd end up on row five when earlier they heard there were only four rows in the table.
I don't know if this would work for your case, but in the demo code, the extra info is related to the person so it could just be hidden information (css display:none) that exists in the first table cell. When you select the button, the information is revealed (css display:block).
Also, you would either need to make the name a row header (<th scope="row">
) or you'd need to associate the person's name with the "more info" button so that the screen reader knows which person they're getting more info about.
I don't know react but the generated html would either look like this (with row headers):
<tr>
<th scope="row">Avicii</th>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button>More info</button>
</td>
</tr>
<tr>
<th scope="row">Kygo</th>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button>More info</button>
</td>
</tr>
or would look like this (with additional information associated with the button):
<span id="moreInfoID" class="sr-only">more info about </span>
...
<tr>
<td id="name1">Avicii</td>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button aria-labelledby="moreInfoID name1">More info</button>
</td>
</tr>
<tr>
<td id="name2">Kygo</td>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button aria-labelledby="moreInfoID name2">More info</button>
</td>
</tr>
The latter is a bit more work. I would recommend the first one.
(You can see info on the sr-only
class at What is sr-only in Bootstrap 3?).
Also, your example shows the new row added has tabindex="0"
. Since the new information is not an interactive object, it should not receive keyboard focus and shouldn't have tabindex.
Thanks! Especially about that row announcement stuff - I didn't know that! Unfortunately, this particular implementation need to be flexible enough for me not to know anything about the content. The expandable content might be related to the first column, or it might not. It also need to span the entire width of the table - which isn't going to work with placing the (potentially very complex) expandable content into the first column
– Kris Selbekk
Nov 15 '18 at 9:27
Yeah, I was kind of afraid of that but wanted to post my initial thoughts and also mention that dynamically adding a row to the table might be confusing for screen reader users. I was still thinking about a more general solution and was going to update my answer if I have time to come up with something.
– slugolicious
Nov 15 '18 at 15:56
Does the "more info" info have to be a row in the table? Can it be displayed as kind of a "mega" tooltip (which would essentially be a modal dialog)? Modal dialogs have their own accessibility challenges, but I can post some resources for that.
– slugolicious
Nov 15 '18 at 16:04
The only time I've seen a table grow dynamically is when rows are added to the bottom of the table, and that's because of a user interaction such as clicking on an "add row" type of button, so it was expected behavior that the table would grow.
– slugolicious
Nov 15 '18 at 16:19
The "more info" info can be whatever, really, but my particular use case is a data heavy workflow where a "pro user" consumes, alters and interacts with a lot of info at once. Triggering a modal could indeed work, but it would also stop the user from being able to look at several detail panels at once, for instance, or comparing one "more info" panel with several other summaries. Perhaps this is best done without a table at all?
– Kris Selbekk
Nov 16 '18 at 13:20
|
show 2 more comments
You essentially have a "disclosure widget". The button that opens/closes the section would have aria-expanded
set to true/false.
However, I would not literally add a new row to the table because that might confuse screen readers. When the table is first navigated to, the user will hear the table has four rows (including the header) and four columns. When you click the "more info" button, the table will now have five rows but the screen reader is not going to tell the user that another row appeared. If the user was navigating down the column and hearing the row numbers (which are normally announced by screen readers), they'd end up on row five when earlier they heard there were only four rows in the table.
I don't know if this would work for your case, but in the demo code, the extra info is related to the person so it could just be hidden information (css display:none) that exists in the first table cell. When you select the button, the information is revealed (css display:block).
Also, you would either need to make the name a row header (<th scope="row">
) or you'd need to associate the person's name with the "more info" button so that the screen reader knows which person they're getting more info about.
I don't know react but the generated html would either look like this (with row headers):
<tr>
<th scope="row">Avicii</th>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button>More info</button>
</td>
</tr>
<tr>
<th scope="row">Kygo</th>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button>More info</button>
</td>
</tr>
or would look like this (with additional information associated with the button):
<span id="moreInfoID" class="sr-only">more info about </span>
...
<tr>
<td id="name1">Avicii</td>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button aria-labelledby="moreInfoID name1">More info</button>
</td>
</tr>
<tr>
<td id="name2">Kygo</td>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button aria-labelledby="moreInfoID name2">More info</button>
</td>
</tr>
The latter is a bit more work. I would recommend the first one.
(You can see info on the sr-only
class at What is sr-only in Bootstrap 3?).
Also, your example shows the new row added has tabindex="0"
. Since the new information is not an interactive object, it should not receive keyboard focus and shouldn't have tabindex.
You essentially have a "disclosure widget". The button that opens/closes the section would have aria-expanded
set to true/false.
However, I would not literally add a new row to the table because that might confuse screen readers. When the table is first navigated to, the user will hear the table has four rows (including the header) and four columns. When you click the "more info" button, the table will now have five rows but the screen reader is not going to tell the user that another row appeared. If the user was navigating down the column and hearing the row numbers (which are normally announced by screen readers), they'd end up on row five when earlier they heard there were only four rows in the table.
I don't know if this would work for your case, but in the demo code, the extra info is related to the person so it could just be hidden information (css display:none) that exists in the first table cell. When you select the button, the information is revealed (css display:block).
Also, you would either need to make the name a row header (<th scope="row">
) or you'd need to associate the person's name with the "more info" button so that the screen reader knows which person they're getting more info about.
I don't know react but the generated html would either look like this (with row headers):
<tr>
<th scope="row">Avicii</th>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button>More info</button>
</td>
</tr>
<tr>
<th scope="row">Kygo</th>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button>More info</button>
</td>
</tr>
or would look like this (with additional information associated with the button):
<span id="moreInfoID" class="sr-only">more info about </span>
...
<tr>
<td id="name1">Avicii</td>
<td>Progressive House</td>
<td>🇸🇪</td>
<td>
<button aria-labelledby="moreInfoID name1">More info</button>
</td>
</tr>
<tr>
<td id="name2">Kygo</td>
<td>Tropical House</td>
<td>🇳🇴</td>
<td>
<button aria-labelledby="moreInfoID name2">More info</button>
</td>
</tr>
The latter is a bit more work. I would recommend the first one.
(You can see info on the sr-only
class at What is sr-only in Bootstrap 3?).
Also, your example shows the new row added has tabindex="0"
. Since the new information is not an interactive object, it should not receive keyboard focus and shouldn't have tabindex.
answered Nov 15 '18 at 9:02
slugoliciousslugolicious
6,13111422
6,13111422
Thanks! Especially about that row announcement stuff - I didn't know that! Unfortunately, this particular implementation need to be flexible enough for me not to know anything about the content. The expandable content might be related to the first column, or it might not. It also need to span the entire width of the table - which isn't going to work with placing the (potentially very complex) expandable content into the first column
– Kris Selbekk
Nov 15 '18 at 9:27
Yeah, I was kind of afraid of that but wanted to post my initial thoughts and also mention that dynamically adding a row to the table might be confusing for screen reader users. I was still thinking about a more general solution and was going to update my answer if I have time to come up with something.
– slugolicious
Nov 15 '18 at 15:56
Does the "more info" info have to be a row in the table? Can it be displayed as kind of a "mega" tooltip (which would essentially be a modal dialog)? Modal dialogs have their own accessibility challenges, but I can post some resources for that.
– slugolicious
Nov 15 '18 at 16:04
The only time I've seen a table grow dynamically is when rows are added to the bottom of the table, and that's because of a user interaction such as clicking on an "add row" type of button, so it was expected behavior that the table would grow.
– slugolicious
Nov 15 '18 at 16:19
The "more info" info can be whatever, really, but my particular use case is a data heavy workflow where a "pro user" consumes, alters and interacts with a lot of info at once. Triggering a modal could indeed work, but it would also stop the user from being able to look at several detail panels at once, for instance, or comparing one "more info" panel with several other summaries. Perhaps this is best done without a table at all?
– Kris Selbekk
Nov 16 '18 at 13:20
|
show 2 more comments
Thanks! Especially about that row announcement stuff - I didn't know that! Unfortunately, this particular implementation need to be flexible enough for me not to know anything about the content. The expandable content might be related to the first column, or it might not. It also need to span the entire width of the table - which isn't going to work with placing the (potentially very complex) expandable content into the first column
– Kris Selbekk
Nov 15 '18 at 9:27
Yeah, I was kind of afraid of that but wanted to post my initial thoughts and also mention that dynamically adding a row to the table might be confusing for screen reader users. I was still thinking about a more general solution and was going to update my answer if I have time to come up with something.
– slugolicious
Nov 15 '18 at 15:56
Does the "more info" info have to be a row in the table? Can it be displayed as kind of a "mega" tooltip (which would essentially be a modal dialog)? Modal dialogs have their own accessibility challenges, but I can post some resources for that.
– slugolicious
Nov 15 '18 at 16:04
The only time I've seen a table grow dynamically is when rows are added to the bottom of the table, and that's because of a user interaction such as clicking on an "add row" type of button, so it was expected behavior that the table would grow.
– slugolicious
Nov 15 '18 at 16:19
The "more info" info can be whatever, really, but my particular use case is a data heavy workflow where a "pro user" consumes, alters and interacts with a lot of info at once. Triggering a modal could indeed work, but it would also stop the user from being able to look at several detail panels at once, for instance, or comparing one "more info" panel with several other summaries. Perhaps this is best done without a table at all?
– Kris Selbekk
Nov 16 '18 at 13:20
Thanks! Especially about that row announcement stuff - I didn't know that! Unfortunately, this particular implementation need to be flexible enough for me not to know anything about the content. The expandable content might be related to the first column, or it might not. It also need to span the entire width of the table - which isn't going to work with placing the (potentially very complex) expandable content into the first column
– Kris Selbekk
Nov 15 '18 at 9:27
Thanks! Especially about that row announcement stuff - I didn't know that! Unfortunately, this particular implementation need to be flexible enough for me not to know anything about the content. The expandable content might be related to the first column, or it might not. It also need to span the entire width of the table - which isn't going to work with placing the (potentially very complex) expandable content into the first column
– Kris Selbekk
Nov 15 '18 at 9:27
Yeah, I was kind of afraid of that but wanted to post my initial thoughts and also mention that dynamically adding a row to the table might be confusing for screen reader users. I was still thinking about a more general solution and was going to update my answer if I have time to come up with something.
– slugolicious
Nov 15 '18 at 15:56
Yeah, I was kind of afraid of that but wanted to post my initial thoughts and also mention that dynamically adding a row to the table might be confusing for screen reader users. I was still thinking about a more general solution and was going to update my answer if I have time to come up with something.
– slugolicious
Nov 15 '18 at 15:56
Does the "more info" info have to be a row in the table? Can it be displayed as kind of a "mega" tooltip (which would essentially be a modal dialog)? Modal dialogs have their own accessibility challenges, but I can post some resources for that.
– slugolicious
Nov 15 '18 at 16:04
Does the "more info" info have to be a row in the table? Can it be displayed as kind of a "mega" tooltip (which would essentially be a modal dialog)? Modal dialogs have their own accessibility challenges, but I can post some resources for that.
– slugolicious
Nov 15 '18 at 16:04
The only time I've seen a table grow dynamically is when rows are added to the bottom of the table, and that's because of a user interaction such as clicking on an "add row" type of button, so it was expected behavior that the table would grow.
– slugolicious
Nov 15 '18 at 16:19
The only time I've seen a table grow dynamically is when rows are added to the bottom of the table, and that's because of a user interaction such as clicking on an "add row" type of button, so it was expected behavior that the table would grow.
– slugolicious
Nov 15 '18 at 16:19
The "more info" info can be whatever, really, but my particular use case is a data heavy workflow where a "pro user" consumes, alters and interacts with a lot of info at once. Triggering a modal could indeed work, but it would also stop the user from being able to look at several detail panels at once, for instance, or comparing one "more info" panel with several other summaries. Perhaps this is best done without a table at all?
– Kris Selbekk
Nov 16 '18 at 13:20
The "more info" info can be whatever, really, but my particular use case is a data heavy workflow where a "pro user" consumes, alters and interacts with a lot of info at once. Triggering a modal could indeed work, but it would also stop the user from being able to look at several detail panels at once, for instance, or comparing one "more info" panel with several other summaries. Perhaps this is best done without a table at all?
– Kris Selbekk
Nov 16 '18 at 13:20
|
show 2 more comments
You could add aria-expanded="true"
to the button when the collapsible section is expanded. And if you have tabindex="0"
on the focusabled items in the table (whole table), you wouldn't worry about tab ordering.
I've updated the sandbox: https://codesandbox.io/s/k5pkj4wzw3
For further reading on accessible collapsible sections (read: expandables), I recommend this article: https://inclusive-components.design/collapsible-sections/
you have a small typo in your sandbox code. you have "ariaexpanded" instead of "aria-expanded"
– slugolicious
Nov 15 '18 at 9:07
add a comment |
You could add aria-expanded="true"
to the button when the collapsible section is expanded. And if you have tabindex="0"
on the focusabled items in the table (whole table), you wouldn't worry about tab ordering.
I've updated the sandbox: https://codesandbox.io/s/k5pkj4wzw3
For further reading on accessible collapsible sections (read: expandables), I recommend this article: https://inclusive-components.design/collapsible-sections/
you have a small typo in your sandbox code. you have "ariaexpanded" instead of "aria-expanded"
– slugolicious
Nov 15 '18 at 9:07
add a comment |
You could add aria-expanded="true"
to the button when the collapsible section is expanded. And if you have tabindex="0"
on the focusabled items in the table (whole table), you wouldn't worry about tab ordering.
I've updated the sandbox: https://codesandbox.io/s/k5pkj4wzw3
For further reading on accessible collapsible sections (read: expandables), I recommend this article: https://inclusive-components.design/collapsible-sections/
You could add aria-expanded="true"
to the button when the collapsible section is expanded. And if you have tabindex="0"
on the focusabled items in the table (whole table), you wouldn't worry about tab ordering.
I've updated the sandbox: https://codesandbox.io/s/k5pkj4wzw3
For further reading on accessible collapsible sections (read: expandables), I recommend this article: https://inclusive-components.design/collapsible-sections/
answered Nov 15 '18 at 8:28
phun-kyphun-ky
155112
155112
you have a small typo in your sandbox code. you have "ariaexpanded" instead of "aria-expanded"
– slugolicious
Nov 15 '18 at 9:07
add a comment |
you have a small typo in your sandbox code. you have "ariaexpanded" instead of "aria-expanded"
– slugolicious
Nov 15 '18 at 9:07
you have a small typo in your sandbox code. you have "ariaexpanded" instead of "aria-expanded"
– slugolicious
Nov 15 '18 at 9:07
you have a small typo in your sandbox code. you have "ariaexpanded" instead of "aria-expanded"
– slugolicious
Nov 15 '18 at 9:07
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314689%2fmake-expandable-table-rows-accessible%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I'm sorry, what's with the downvote?
– Kris Selbekk
Nov 15 '18 at 12:33
1
not sure, wasn't me
– slugolicious
Nov 15 '18 at 15:53