Skip to content

Commit

Permalink
fix: dom managment conflicts in info windows and custom markers
Browse files Browse the repository at this point in the history
  • Loading branch information
HusamElbashir committed Jun 27, 2022
2 parents bb5372f + f8f6bef commit 1cd817b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
15 changes: 6 additions & 9 deletions src/components/CustomMarker.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<template>
<div
ref="customMarkerRef"
v-if="hasSlotContent"
class="custom-marker-content"
:style="{ cursor: !!$attrs.onClick ? 'pointer' : undefined }"
>
<slot />
<div v-if="hasSlotContent" class="custom-marker-wrapper">
<div ref="customMarkerRef" :style="{ cursor: !!$attrs.onClick ? 'pointer' : undefined }">
<slot />
</div>
</div>
</template>

Expand Down Expand Up @@ -41,11 +38,11 @@ export default defineComponent({
</script>

<style scoped>
.custom-marker-content {
.custom-marker-wrapper {
display: none;
}
.mapdiv .custom-marker-content {
.mapdiv .custom-marker-wrapper {
display: inline-block;
}
</style>
10 changes: 6 additions & 4 deletions src/components/InfoWindow.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div ref="infoWindowRef" v-if="hasSlotContent" class="info-window-content">
<slot />
<div v-if="hasSlotContent" class="info-window-wrapper">
<div ref="infoWindowRef">
<slot />
</div>
</div>
</template>

Expand Down Expand Up @@ -104,11 +106,11 @@ export default defineComponent({
</script>

<style scoped>
.info-window-content {
.info-window-wrapper {
display: none;
}
.mapdiv .info-window-content {
.mapdiv .info-window-wrapper {
display: inline-block;
}
</style>

0 comments on commit 1cd817b

Please sign in to comment.