Skip to content
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

List: focusin event doesn't bubble #9787

Closed
1 task done
Lukas742 opened this issue Sep 2, 2024 · 5 comments · Fixed by #10156
Closed
1 task done

List: focusin event doesn't bubble #9787

Lukas742 opened this issue Sep 2, 2024 · 5 comments · Fixed by #10156
Assignees
Labels
bug This issue is a bug in the code Medium Prio TOPIC P

Comments

@Lukas742
Copy link
Collaborator

Lukas742 commented Sep 2, 2024

Bug Description

This is a followup issue to this issue:
SAP/ui5-webcomponents-react#6294

The focusin event of the List component doesn't bubble which prevents the synthetic onFocus event of React to work correctly (internally it implements focusin for the native event). React example.

Also, it is not possible registering the focusin event of the ui5-list element itself, for example to identify which ui5-li is focused. Of course, one could register a focusin event for each ui5-li, but it would be much easier to just add it to the parent component. The standard is, that focusin events bubble, if that's no possible for this implementation, I think it would be worth mentioning that in the docs.

I've edited the example of the linked issue to show this behavior: plain ui5wc example

Affected Component

No response

Expected Behaviour

The focusin event should bubble.

Isolated Example

https://stackblitz.com/edit/github-pwfft8?file=index.html,main.js

Steps to Reproduce

  1. See StackBlitz example
  2. Navigate through list via keyboard keys (Tab for enter, arrow keys for list items)
  3. Navigate through buttons via keyboard keys (Tab)
  4. See the difference

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

2.1.2

Browser

Chrome, Edge, Firefox, Safari

Operating System

No response

Additional Context

No response

Organization

UI5WCR

Declaration

  • I’m not disclosing any internal or sensitive information.
@kskondov
Copy link
Contributor

kskondov commented Sep 3, 2024

Hello @ui5-webcomponents-topic-p,

Can you please take a look at the reported issue and check the possibilities to bubble the focusin event or document that it does not as proposed by @Lukas742

Best Regards,
Konstantin

@kskondov kskondov removed their assignment Sep 3, 2024
@NakataCode NakataCode self-assigned this Sep 27, 2024
@NakataCode
Copy link
Contributor

Hi @Lukas742 ,

You can attach the "item-focused" event to the list component to track the focused ui5-li item.
Would this approach work for your scenario?

@Lukas742
Copy link
Collaborator Author

Hi @NakataCode

the item-focused event is a private event and using private APIs is something that should generally be avoided right? Also, how should developers know that they should use this event?

Another problem is, that our wrapper only wraps public events, so developers would need to attach the event listener themselves and can't use React props to achieve this.

Copy link

github-actions bot commented Nov 5, 2024

Hello, everyone! The issue has been inactive for 21 days. If there are still questions or comments, please feel free to continue the discussion. Inactive issues will be closed after 7 days!

@github-actions github-actions bot added the Stale label Nov 5, 2024
@Lukas742
Copy link
Collaborator Author

Lukas742 commented Nov 5, 2024

@NakataCode this issue is still relevant, if there's additional information required please let me know.

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 Medium Prio TOPIC P
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

4 participants