Closed SC-Serhii-Litvinov closed 3 weeks ago
Hi @gedinakova . Could you please share some details on how issue have been solved.
Hi @SC-Serhii-Litvinov, in essence we now make sure that after closing a floating pane we are not attempting to loop through a collection that is undefined. However, please note, that we closed this by mistake, as it will be released in the next DockManager version which should happen in the next 2 weeks.
You are still relying on requestAnimationFrame
to process events, am I right?
Yes, we do, that hasn't changed.
Released in 1.15.0
Description
Error appears in a console during pane closing
Steps to reproduce
We have a requirement to allow user confirm or decline pane closing. To to achieve this we subscribe to
paneClose
event and do calle.preventDefault()
.After confirmation received we remove the pane. However if you click fast enough to thing will happen. Note not all panes will require confirmation, some will just close without any additional user interaction. It' s impossible upfront to distingue between such panes. So prevent
preventDefault
is called for all panes.The cause of an issue is code inside
requestAnimationFrame
.contentPanesElementMap
no longer contains requested pane. The pane had already been closed.UPDATE[17.06.2024] Sample application had been created to reproduce. In total there are three errors in this flow:
handlePaneHeaderMouseDown
: Cannot read properties of undefined (reading 'focus')closePane
: Cannot read properties of undefined (reading 'type')bringFloatingPaneOnTop
: TypeError: floatingPanes is not iterable It feels like all errors do have the same root causeNote: in order to reproduce timing should be just right. Might not happen from the first attempt
To reproduce: try closing Floating Pane via double clicking close button. Sample application link
Result
Uncaught TypeError: Cannot read properties of undefined (reading 'focus')
Expected result
The panel closed without errors in the console