Link: Unable to activate Link through ENTER key press
See original GitHub issueDescribe 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:
- Go to https://codesandbox.io/s/sad-faraday-voiil?file=/src/App.js
- Press
Tab
key to focus on the Link: ‘Focus me and press Enter’ - Press
Enter
key - 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:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @2bno1
you need to add the corresponding key event for this to work. Example
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.