nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
Other
2.08k stars 625 forks source link

Enter Keypress on Parent triggers mouse click of Inner child followed by parent click #8326

Open sanjay1909 opened 6 years ago

sanjay1909 commented 6 years ago

Steps to reproduce:

A list of the steps you take to demonstrate the problem. https://codepen.io/sanjay1909-the-lessful/pen/erozeP Try with NVDA to see the Issue mentioned in Title Kill the NVDA app and try Experimented in Browser: Firefox and Chrome

Expected behavior:

Expected behavior is What you see in that example when NVDA app is killed Keypress should call kyepress event listeners focus shouldn't shift to an inner child for Enter|space key

Actual behavior:

Keypress calling Mouse event listeners focus shifting to an inner child for Enter|space key

System configuration:

NVDA version: 2018.1

NVDA Installed or portable:

Windows version:

Example: Windows 10 Pro Version 1803

Name and version of other software in use when reproducing the issue:

Other questions:

Does the issue still occur after restarting your PC? Yes

Have you tried any other versions of NVDA?

No

sanjay1909 commented 6 years ago

Summary of the Issue

  1. Focus Shifts to inner Child When we press Enter or Space Key. As a result, child click event happens before parent click event.
  2. KeyPress Triggers Mouse click event

Issue 2 was addressed here, https://github.com/nvaccess/nvda/issues/4903 . Thanks

derekriemer commented 6 years ago

Was this in browse or focus mode.

sanjay1909 commented 6 years ago

It's in Browse Mode with Checkbox selected for Automatic focus for focus changes

https://codepen.io/anon/pen/MGdYRW In this example, I removed the tabindex on the child, But still, the click event attached for the

  1. child got executed and
  2. Executed first before the parent
Adriani90 commented 5 years ago

cc: @jcsteh, @feerrenrut I think I can reproduce this issue in NvDA 2019.1.1 but since I canot use a pc without a screen reader I cannot really tell what happens when testing without NVDA running.

feerrenrut commented 5 years ago

Without getting into the details, I'm not 100% sure what the test code is telling us. I got the following results without NVDA running: Pressing space with the parent div focused

ParentClick[0] ParentKeypress[1] ChildClick[0] ChildKeypress[0] 
- parentKeyPress

Clicking on the child div:

ParentClick[1] ParentKeypress[0] ChildClick[1] ChildKeypress[0] 
- childClick - parentClick

This issue requires work to clarify. The template has not been followed correctly and the expected results of the test case are also not explained. There should also be some explanation as to why the expected behaviour should be the case. The issue is unlikely to get worked on in it's current state.

Adriani90 commented 4 years ago

@sanjay1909 how is this behavior in NVDA 2019.3 Beta 1? Could you please give an update?

SuperAL commented 4 years ago

@sanjay1909 try listening to keyup event on child, possible event timeline:

  1. listen to keydown event on parent and trigger keydown
  2. the event handler on parent was triggered and move the focus to child
  3. child receives keyup event and trigger click handler

FYI: I encountered this situation when using material ui component, my solution is to move focus to child on keyup instead keydown.

Adriani90 commented 1 month ago

@sanjay1909 is this still an issue with NvDA 2024.2 or 2024.3 Beta?