Skip to content

Commit

Permalink
Watch the className prop to update the popup.
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed May 27, 2024
1 parent 38ee649 commit 8195dc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/components/controls/custom.control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default defineComponent({
*/
class: {
type: String as PropType<string>,
default: 'maplibregl-ctrl maplibregl-ctrl-group',
default: "maplibregl-ctrl maplibregl-ctrl-group",
},
},
slots: Object as SlotsType<{ default: unknown }>,
Expand Down
11 changes: 11 additions & 0 deletions lib/components/popup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ export default defineComponent({
() => props.maxWidth,
(v) => popup.setMaxWidth(v),
);
watch(
() => props.className,
(value, previous) => {
if (previous) {
popup.removeClassName(p);

Check failure on line 179 in lib/components/popup.component.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'p'.

Check failure on line 179 in lib/components/popup.component.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'p'.
}
if (value) {
popup.addClassName(v);

Check failure on line 182 in lib/components/popup.component.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'v'.

Check failure on line 182 in lib/components/popup.component.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'v'.
}
},
);
watch(
() => props.subpixelPositioning,
(v) => popup.setSubpixelPositioning(v),
Expand Down

0 comments on commit 8195dc8

Please sign in to comment.