Skip to content

Commit

Permalink
Manage tabIndex attribute for hidden TextFields
Browse files Browse the repository at this point in the history
  • Loading branch information
ceciliaavila committed Nov 7, 2019
1 parent a070872 commit 8636f77
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,14 @@ export class EndpointEditor extends Component<EndpointEditorProps, EndpointEdito
data-prop="serviceName"
value={serviceName}
label="Azure BotId"
tabIndex={-1}
/>
<TextField
onChange={this.onBotInputChange}
data-prop="tenantId"
value={tenantId}
label="Azure Directory ID"
tabIndex={-1}
/>
</Row>
<Row className={styles.absTextFieldRow}>
Expand All @@ -206,12 +208,14 @@ export class EndpointEditor extends Component<EndpointEditorProps, EndpointEdito
value={subscriptionId}
data-prop="subscriptionId"
label="Azure Subscription ID"
tabIndex={-1}
/>
<TextField
data-prop="resourceGroup"
onChange={this.onBotInputChange}
value={resourceGroup}
label="Azure Resource Group"
tabIndex={-1}
/>
</Row>
</div>
Expand Down Expand Up @@ -303,6 +307,11 @@ export class EndpointEditor extends Component<EndpointEditorProps, EndpointEdito
const newHeight = expanded ? clientHeight : 0;
this.absContent.style.height = `${newHeight}px`;
currentTarget.setAttribute('aria-expanded', expanded + '');
this.absContent.querySelectorAll('input').forEach((node: HTMLElement) => {
if (node.hasAttribute('tabIndex')) {
node.setAttribute('tabIndex', expanded ? '0' : '-1');
}
});
};

private absContentRef = (ref: HTMLDivElement): void => {
Expand Down

0 comments on commit 8636f77

Please sign in to comment.