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

[ToolbarButton]: getDomRef returns undefined #9996

Open
1 task done
Lukas742 opened this issue Oct 9, 2024 · 1 comment · May be fixed by #10009
Open
1 task done

[ToolbarButton]: getDomRef returns undefined #9996

Lukas742 opened this issue Oct 9, 2024 · 1 comment · May be fixed by #10009
Assignees
Labels
bug This issue is a bug in the code Medium Prio TOPIC P

Comments

@Lukas742
Copy link
Collaborator

Lukas742 commented Oct 9, 2024

Bug Description

When calling getDomRef() on a ui5-toolbar-button it always returns undefined.

This is a followup issue to this one: #9997

Affected Component

ToolbarButton

Expected Behaviour

It should return the DOM reference to the ui5-button inside the shadow root of the ui5-toolbar, as the ToolbarButton is an abstract component.

Isolated Example

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

Steps to Reproduce

  1. Got to StackBlitz
  2. Open dev tools
  3. Press Log getDomRef button
  4. See undefined in the console

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

2.3.0

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.
@NHristov-sap
Copy link
Contributor

Hello @ui5-webcomponents-topic-p,

The reported issue is reproducible, that's why I am forwarding this issue to you to take care of it.

Best Regards,
Nikolay Hristov

@kgogov kgogov self-assigned this Oct 11, 2024
kgogov added a commit that referenced this issue Oct 11, 2024
…ference

This commit fixes the issue where `getDomRef()` on `ui5-toolbar-button`
was returning `undefined` by providing a custom implementation that
correctly returns the DOM reference to the actual `ui5-button` element
rendered within the `ui5-toolbar`'s shadow DOM. This enhancement ensures
that developers can reliably interact with the toolbar button's DOM
element.

**Notes:**
- This fix assumes that `ui5-toolbar-button` is a direct child of
  `ui5-toolbar`.
- If the component hierarchy changes, additional checks may be necessary
  to ensure the parent toolbar is correctly identified.

Fixes: #9996
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: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants