Bug Description
the implementation of patchFocusEvent, which is applied via https://github.com/UI5/webcomponents/blob/v1.24.28/packages/base/src/features/patchPopup.ts is buggy as it causes on Firefox the abovementioned exception target.closest is not a function when a popup is open, the user navigates away from the window (e.g., address bar) and then focuses the popup again. Firefox first fires a focus event which is target ad the Document rather than the element and the document has no closest function
We see it happening on customer side:

Affected Component
UI5/webcomponents/blob/v1.24.28/packages/base/src/features/patchPopup.ts
Expected Behaviour
no crash in this case
Isolated Example
https://jsfiddle.net/38vcnery/1/
Steps to Reproduce
go to https://jsfiddle.net/38vcnery/1/ . This is a very simple repo example
- navigate inside the rendering area, the exception happens
Log Output, Stack Trace or Screenshots
No response
Priority
No response
UI5 Web Components Version
1.24.28
Browser
Firefox
Operating System
No response
Additional Context
An additional check if for target instanceof Element prevents the crash
No response
Organization
SAP
Declaration
Bug Description
the implementation of patchFocusEvent, which is applied via https://github.com/UI5/webcomponents/blob/v1.24.28/packages/base/src/features/patchPopup.ts is buggy as it causes on Firefox the abovementioned exception target.closest is not a function when a popup is open, the user navigates away from the window (e.g., address bar) and then focuses the popup again. Firefox first fires a focus event which is target ad the Document rather than the element and the document has no
closestfunctionWe see it happening on customer side:

Affected Component
UI5/webcomponents/blob/v1.24.28/packages/base/src/features/patchPopup.ts
Expected Behaviour
no crash in this case
Isolated Example
https://jsfiddle.net/38vcnery/1/
Steps to Reproduce
go to https://jsfiddle.net/38vcnery/1/ . This is a very simple repo example
Log Output, Stack Trace or Screenshots
No response
Priority
No response
UI5 Web Components Version
1.24.28
Browser
Firefox
Operating System
No response
Additional Context
An additional check if for
target instanceof Elementprevents the crashNo response
Organization
SAP
Declaration