DetailsList: onClick in onRenderRow breaks a11y table navigation
Actual behavior:
When I have the onRenderRow and I added an onClick in a div inside the onRenderRow. This works fine except now the table doesn't navigate properly using Ctrl+Alt+Arrow key (Edge/Narrator). Here is a code pen with the issue: https://codepen.io/jgage176/pen/bGGzGvJ. If you remove line 235 (the onClick of the div) it works just fine. Here is the only code I inserted from the standard codepen I got from the Office Fabric site:
onRenderRow={(props, defaultRender?): JSX.Element => {
const divProps = {
onClick: () => { },
};
return (
<div {...divProps}>
{defaultRender && defaultRender(props)}
</div>
);
}}
Expected behavior:
When you get to the table (Scan Mode on, hit T, press Ctrl+Alt+Down it should go down to the first row, first column, but it will only go through the headers (acts like there are zero rows). I should be able to have a div inside of an onRenderRow and have it handle onClick events. Basically, I need to handle when the user clicks the row but don't want to block anything here.
Documentation describing expected behavior
https://support.microsoft.com/en-us/help/22806/windows-10-narrator-keyboard-commands-touch-gestures
@jgage176 Thank you for reaching out to us! Clarification - are you saying having the div inside onRenderRow is breaking the ctrl+alt+arrow functionality? Also I believe with scan off, this still works - have you tried that on your end? Because then it might be a Narrator scan mode problem (of which there are lots).
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!
Found out that if I add role="presentation" to the div above that everything starts working. I don't think it is an intended behavior the way it broke, but I think it is either in the React layer or in the narrator itself (with scan mode on), so it wasn't actually Office Fabric that did this.