Popover: Types for close() is wrong
Describe the bug
The types for close() method for the Popover is currently
// node_modules/@ui5/webcomponents-react/dist/webComponents/Popover/index.d.ts
close: () => void;
But when I debug, I can see it takes in three parameters
// node_modules/@ui5/webcomponents/dist/Popup.js
close(escPressed = false, preventRegistryUpdate = false, preventFocusRestore = false) {
...
}
I want my code to pass preventFocusRestore to false which I am currently not able to without using this syntax
((popoverRef.current as any)?.close)(false, false, true);
It would be great if the types are updated so that I don't have to typecast the ref to any
Isolated Example
https://stackblitz.com/edit/github-bdj64s?file=src%2FApp.tsx
Reproduction steps
...
Expected Behaviour
It should have the types of the arguments
Screenshots or Videos
No response
UI5 Web Components for React Version
1.26.2
UI5 Web Components Version
1.23.3
Browser
Chrome
Operating System
MacOS
Additional Context
No response
Relevant log output
No response
Organization
SAP
Declaration
- [X] I’m not disclosing any internal or sensitive information.
Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.
Hi colleagues,
it looks like not all parameters of of close() method of the Popover (inherited from Popup) are part of the custom element manifest:
https://unpkg.com/browse/@ui5/[email protected]/dist/custom-elements-internal.json
Line 12530 (Popover/onClose) and Line 12766 (Popup/onClose) have no parameters at all.
Hi @vishnuvardhan-s,
These parameters are not described in the types since they are used internally. For preventing focus restore we provide property called preventFocusRestore to the ui5-popover (https://sap.github.io/ui5-webcomponents/components/Popover/#preventfocusrestore). Could you please check if this property will suite for your use case?
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!
Thank you @nnaydenow! Closing the issue