File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -403,19 +403,21 @@ export default class Arrow {
403403 * Función que recibe el id de una flecha y la elimina.
404404 * @param {ArrowIdType } id arrow id
405405 */
406- removeArrow ( id ) {
406+ removeArrow ( id ) {
407407 const index = this . _dependency . findIndex ( dep => dep . id === id ) ;
408408
409409 if ( index >= 0 ) {
410+ // Get the path element from our specific array before modifying the arrays
411+ const pathToRemove = this . _dependencyPath [ index ] ;
410412
411- //var list = document.getElementsByTagName("path"); //FALTA QUE ESTA SELECCION LA HAGA PARA EL DOM DEL TIMELINE INSTANCIADO!!!!
412- const list = document . querySelectorAll ( "#" + this . _timeline . dom . container . id + " path" ) ;
413+ // Remove the SVG element from the DOM
414+ if ( pathToRemove && pathToRemove . parentNode ) {
415+ pathToRemove . parentNode . removeChild ( pathToRemove ) ;
416+ }
413417
414- this . _dependency . splice ( index , 1 ) ; //Elimino del array dependency
415- this . _dependencyPath . splice ( index , 1 ) ; //Elimino del array dependencyPath
416-
417- list [ index + 1 ] . parentNode ?. removeChild ( list [ index + 1 ] ) ; //Lo elimino del dom
418-
418+ // Now, remove the arrow from internal arrays
419+ this . _dependency . splice ( index , 1 ) ;
420+ this . _dependencyPath . splice ( index , 1 ) ;
419421 }
420422 }
421423
@@ -462,4 +464,4 @@ export default class Arrow {
462464 this . removeItemArrows ( id ) ;
463465 }
464466
465- }
467+ }
You can’t perform that action at this time.
0 commit comments