ui5-webcomponents-react
ui5-webcomponents-react copied to clipboard
[Popover]: Cannot use DOM reference as the opener of the popover.
Describe the bug
The opener support either a DOM id string, or a HTML Element DOM reference. However, the type is only defined as string. Please see: react Popover/index.tsx#L94 vs ui5-webcomponents Popover.ts#L174. In my scenario I would like to use a dom ref, but the types are failing with the following:
As a workaround I tried something like
opener={(opener.current as unknown as string)}
But then it fails later as Valid opener id is required. since the dom reference is actually getting passed as a string to the webcomponent "[Object HTMLElement]".
Isolated Example
Reproduction steps
- Open the isolated example, and notice the ts compilation error
- Then, if you hack the type safety, notice the popover still does not open and you get the warning in the console. ...
Expected Behaviour
You should be able to use a dom ref as the opener for popovers.
UI5 Web Components for React Version
1.22.2
UI5 Web Components Version
1.19.1
Browser
Chrome
Organization
SF
Declaration
- [X] I’m not disclosing any internal or sensitive information.