Skip to content

PB-1456: Fix drag layer issue#1255

Merged
pakb merged 5 commits intodevelopfrom
bug-pb-1456-duplicated-layer-when-dragging
Mar 17, 2025
Merged

PB-1456: Fix drag layer issue#1255
pakb merged 5 commits intodevelopfrom
bug-pb-1456-duplicated-layer-when-dragging

Conversation

@ismailsunni
Copy link
Contributor

@ismailsunni ismailsunni commented Feb 27, 2025

@github-actions github-actions bot added the bug label Feb 27, 2025
@cypress
Copy link

cypress bot commented Feb 27, 2025

web-mapviewer    Run #4813

Run Properties:  status check passed Passed #4813  •  git commit 209989728c: Merge pull request #1255 from geoadmin/bug-pb-1456-duplicated-layer-when-draggin...
Project web-mapviewer
Branch Review develop
Run status status check passed Passed #4813
Run duration 01m 41s
Commit git commit 209989728c: Merge pull request #1255 from geoadmin/bug-pb-1456-duplicated-layer-when-draggin...
Committer Pascal Barth
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 1
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 48
View all changes introduced in this branch ↗︎

@ismailsunni ismailsunni force-pushed the bug-pb-1456-duplicated-layer-when-dragging branch 2 times, most recently from c514b7d to aab1c4b Compare February 27, 2025 04:15
@ismailsunni ismailsunni marked this pull request as ready for review February 27, 2025 04:15
@ismailsunni ismailsunni force-pushed the bug-pb-1456-duplicated-layer-when-dragging branch 3 times, most recently from bdbc82e to 7c9619a Compare March 6, 2025 04:42
@ismailsunni ismailsunni requested a review from pakb March 6, 2025 07:20
Comment on lines +56 to +68
nextTick(() => {
// Get all children with draggable="false" and remove them
const nonDraggableChildren =
activeLayersList.value.querySelectorAll('[draggable="false"]')
if (nonDraggableChildren.length > 0) {
nonDraggableChildren.forEach((child) => child.remove())
log.debug('Non-draggable children removed:', nonDraggableChildren)
} else {
log.debug('No non-draggable children found')
}
onMoveLayer(reverseIndex(oldIndex), reverseIndex(newIndex))
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works ok. nice find!
can you add a little comment to explain why we are doing this search and destroy on draggable=false?
Just make it clear that is is to fix this bug so we don't remove it in the future because we don't understand why 😉

@pakb pakb force-pushed the bug-pb-1456-duplicated-layer-when-dragging branch from 7c9619a to 4c9890e Compare March 17, 2025 16:26
@pakb pakb merged commit 2099897 into develop Mar 17, 2025
6 checks passed
@pakb pakb deleted the bug-pb-1456-duplicated-layer-when-dragging branch March 17, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants