question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link: Unable to activate Link through ENTER key press

See original GitHub issue

Describe the bug Per document, onClick should be “Fired when the Link is triggered either with a mouse/tap or by using the Enter key.” However, onClick is not called by using Enter Key when it’s focused.

Isolated Example https://codesandbox.io/s/sad-faraday-voiil?file=/src/App.js

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/sad-faraday-voiil?file=/src/App.js
  2. Press Tab key to focus on the Link: ‘Focus me and press Enter’
  3. Press Enter key
  4. The onClick is not fired

Expected behavior The onClick of the Link component should be fired by pressing Enter key

Screenshots If applicable, add screenshots to help explain your problem.

UI5 Web Components for React Information @ui5/webcomponents version: 0.29.8 (@sf) @ui5/webcomponents-react version: 0.129.8 (@sf) Operating System: macOS Version 11.2.3 Browser: Chrome Version 89.0.4389.90

Additional context N/A

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Lukas742commented, Mar 24, 2021

Hi @2bno1

you need to add the corresponding key event for this to work. Example

0reactions
ilhan007commented, Jun 1, 2021

Hello @SAP/ui5-webcomponents-topic-b @tsanislavgatev

Could you take over this issue?

The ui5-link does not fire the “click” event on pressing the Enter key. The openui5 Link, for reference is firing its “press” event on Enter (even if “href” is not present), so I guess we have to fix this to make the web component behaves the same as the openui5 Link.

The author has provided an isolated example and steps to reproduce.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enter key triggering link - javascript - Stack Overflow
I need to have it that the user can press the enter key instead of clicking on the link. Now the problem is:...
Read more >
Can't open link with Enter using JAWS/IE11 · Issue #58 - GitHub
A link with some basic HTML that should be identified as a link does not activate when it has focus and enter is...
Read more >
Enter Key makes link button work - MSDN - Microsoft
I have a a link button on my page. When someone hits the enter ... It currently works great if click, but not...
Read more >
How To Trigger Button Click on Enter - W3Schools
Trigger a button click on keyboard "enter" with JavaScript. ... Click on Enter. Press the "Enter" key inside the input field to trigger...
Read more >
Links - Usability & Web Accessibility - Yale University
Keyboard -only users press the tab key to navigate through interactive elements like links. As such, it is important that users be able...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found