【发布时间】:2018-09-11 20:30:19
【问题描述】:
所以我有一个 react-redux 电子商务应用程序,但在弄清楚如何让屏幕阅读器从支付部分转到订单摘要组件并阅读订单摘要时遇到了问题。
现在,如果我点击订单摘要内容,这是一个表格,包括 h4 标题,屏幕阅读器会读取它,但我无法从付款部分选择它。
这是 OrderSummary.js 文件:
<h2 className="title h3">Order Summary</h2>
<table className="subtotal-wrapper body-color">
<caption className="screen-reader-text">Order Summary</caption>
<tbody>
<tr>
<th>Subtotal:</th>
<td>${formatPrice(this.props.orderSummary.originalSubtotal)}</td>
</tr>
{showShippingCost(this.props.orderSummary.totalShippingCost, this.props.orderSummary.totalShippingDiscount)}
<tr>
<th>Est Sales Tax:</th>
<td>${formatPrice(this.props.orderSummary.totalEstimatedTax)}</td>
</tr>
{getOptionalComponent('Total Savings:', this.props.orderSummary.discountedSubtotal)}
</tbody>
</table>
因此,当切换时,ChromeVox 和 VoiceOver 将从 Address.js 组件中的这个表单开始:
<form className="marketing-offer" onSubmit={doNothing} >
<Checkbox
name="marketingOptIn"
checked={!!this.props.marketingOptIn}
onChange={this.props.handleMarketingOptInChange}
>
<span className="payment-option special-offers">Yes! I would like to receive updates, special offers, and other information from shopDisney and The Walt Disney Family of Companies.</span>
</Checkbox>
</form>
直接到Continue to Review的订单汇总按钮,完全跳过OrderSummary.js中的表格。
如果我故意点击它,它会读取它,但它不会像我想要的那样从Address.js 到OrderSummary.js 内的表单字段中的复选框中选择标签。
我该如何解决这个问题?
【问题讨论】:
标签: javascript react-redux screen-readers