最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to prevent NVDA from reading "Div" as clickable? - Stack Overflow

programmeradmin4浏览0评论

Below is my sample code, when user clicks arrow-down NVDA is reading section as clickable.

<section>
<p>How would you like to pay?</p>
<form>
<input type="text"/>
<button type="submit">Add</button>
</form>
</section>

I read somewhere that NVDA considers <section> as clickable, so I have tried changing <section> to <div> tag as shown below:

<div>
<p>How would you like to pay?</p>
<form>
<input type="text"/>
<button type="submit">Add</button>
</form>
</div>

But the issue still exist. It is reading:

clickable How would you like to pay?

Should not read <div> as clickable.

Below is my sample code, when user clicks arrow-down NVDA is reading section as clickable.

<section>
<p>How would you like to pay?</p>
<form>
<input type="text"/>
<button type="submit">Add</button>
</form>
</section>

I read somewhere that NVDA considers <section> as clickable, so I have tried changing <section> to <div> tag as shown below:

<div>
<p>How would you like to pay?</p>
<form>
<input type="text"/>
<button type="submit">Add</button>
</form>
</div>

But the issue still exist. It is reading:

clickable How would you like to pay?

Should not read <div> as clickable.

Share Improve this question edited Nov 4, 2019 at 11:57 T J 43.2k13 gold badges86 silver badges142 bronze badges asked Oct 31, 2019 at 10:10 Archana BichaveArchana Bichave 511 silver badge2 bronze badges 1
  • 2 There's nothing here that would indicate that NVDA would announce this div or section as clickable, but here are some places to start looking: (1) does NVDA only start announcing clickable when you enter the div/section? (2) are there any javascript event handlers present on the page? (3) is there any HTML added to the DOM through scripting? If you can provide more code, you may get more helpful responses. – Josh Commented Nov 1, 2019 at 16:31
Add a ment  | 

3 Answers 3

Reset to default 2

https://github./nvaccess/nvda/issues/5830 NVDA reads "Clickable" if there is mouse events associated with the dom element in question.

Here is a work around. in your section tag add:

<section role="presentation">

read this:

https://www.accessibility-developer-guide./examples/sensible-aria-usage/presentation/

One solution would be to set tabindex=0 on the paragraph tag.

发布评论

评论列表(0)

  1. 暂无评论