Skip to content

<Link> Component only trigged click on keyboard "Enter" but not in "SPACE" #3590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ivaylo-stoilov opened this issue Aug 4, 2021 · 2 comments
Labels
bug This issue is a bug in the code duplicate This issue or pull request already exists TOPIC B

Comments

@ivaylo-stoilov
Copy link

Describe the bug

Component need to trigger click when press keyboard "SPACE"

Observed behavior:

Component need to trigger click when press keyboard "SPACE"

Expected Behavior:

Component need to trigger click on booth keyboard events : when press "ENTER" and "SPACE" Key.

Isolated Example
Please provide an isolated example if possible by forking this codesandbox.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/ui5-webcomponents-react-template-29l34
  2. add <Link href="/#" onClick={() => alert("Link is clicked")}>Test LINK and impored as well : import { Link } from '@ui5/webcomponents-react';
  3. navigate to link with keybord "Tab." and press Enter alert is show.
  4. navigate to link with keybord "Tab." and press SPICE here is no alert

UI5 Web Components for React Information
@ui5/webcomponents version:
@ui5/webcomponents-react version:
Operating System: wi
Browser:

Additional context
Add any other context about the problem here.

@Lukas742
Copy link
Collaborator

Lukas742 commented Aug 4, 2021

Hi @ivaylo-stoilov

since the Link component is developed by our UI5 Web Components colleagues, I'm going to forward this issue to their repo.

Btw, you can use our codeSandbox template to showcase your issue by editing it. CodeSandbox will then create a fork of it with a new link and you can just post the link here so we can take a look at it ;)

I also created a codeSandbox example that shows this behavior with plain webcomponents: https://codesandbox.io/s/nifty-lake-z68rn?file=/src/App.js

  1. Focus the link with Tab and open the console.
  2. Press the "Space" key and see that only the keydown event was fired and no navigation occurred.
  3. Press "Enter" and see that the keydown and click event was fired and a navigation did occur.
  4. Click the Link and see that the click event was fired and a navigation did occur.

@Lukas742 Lukas742 transferred this issue from SAP/ui5-webcomponents-react Aug 4, 2021
@ilhan007
Copy link
Member

ilhan007 commented Aug 4, 2021

Hello @SAP/ui5-webcomponents-topic-b, @ivaylo-stoilov
this is duplicate of #3007 and fixed with: fixed with: #3374

You can test the Link using the test pages, running with the master version:
https://sap.github.io/ui5-webcomponents/master/playground/main/pages/Link/

The fix will be available with the 1.0.0-rc.15 version.

@ilhan007 ilhan007 closed this as completed Aug 4, 2021
@ilhan007 ilhan007 added duplicate This issue or pull request already exists TOPIC B bug This issue is a bug in the code labels Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug in the code duplicate This issue or pull request already exists TOPIC B
Projects
None yet
Development

No branches or pull requests

3 participants