File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/phoenix-event-display/src/managers/three-manager Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -187,11 +187,21 @@ export class SelectionManager {
187187 /**
188188 * Enable passive double-click detection (always active, independent of selection).
189189 * Sets up event listeners for both main and overlay canvases.
190+ * This method can be called multiple times safely due to listener deduplication.
190191 */
191192 private enablePassiveDoubleClick ( ) {
192193 // Main canvas (always available)
193194 const mainCanvas = document . getElementById ( 'three-canvas' ) ;
194195 if ( mainCanvas ) {
196+ // Remove existing listeners to avoid duplicates on re-initialization
197+ mainCanvas . removeEventListener (
198+ 'mousedown' ,
199+ this . onPassiveMouseDown ,
200+ true ,
201+ ) ;
202+ mainCanvas . removeEventListener ( 'mouseup' , this . onPassiveMouseUp , true ) ;
203+
204+ // Add listeners
195205 mainCanvas . addEventListener ( 'mousedown' , this . onPassiveMouseDown , true ) ;
196206 mainCanvas . addEventListener ( 'mouseup' , this . onPassiveMouseUp , true ) ;
197207 }
You can’t perform that action at this time.
0 commit comments