Skip to content

[ListBox] KeyDownEnter click first button it finds.  #904

@jeffgrannes

Description

@jeffgrannes

🐛 Bug report

When focused on an ListBox in a form, when the enter key is pressed the ListBox was incorrectly clicking a button outside the form with type='button'

Current Behavior

Pressing enter on ListBox will click first button found in the DOM.

Expected behavior

The ListBox would click a button with no type or an element with type='submit'.

Suggested solution(s)

We can be more specific to which buttons get clicked - a proposed fix is in this PR:
#903

Your environment

Software Name(s) Version
Reach Package   0.16.5
React   17.0.2
Browser   Chrome
Assistive tech    
Node   14.17.5
npm/yarn yarn 1.22.11
Operating System MacOS MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions