Skip to content

Commit

Permalink
fix(message): getContainer prop doesn't work (#6942)
Browse files Browse the repository at this point in the history
  • Loading branch information
kovsu committed Sep 15, 2023
1 parent 2c4d465 commit 2f7f0e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion components/_util/Portal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import PropTypes from './vue-types';
import { defineComponent, nextTick, onBeforeMount, onUpdated, Teleport, watch } from 'vue';
import {
defineComponent,
nextTick,
onBeforeMount,
onMounted,
onUpdated,
Teleport,
watch,
} from 'vue';
import { useInjectPortal } from '../vc-trigger/context';

export default defineComponent({
Expand All @@ -17,6 +25,8 @@ export default defineComponent({
const { shouldRender } = useInjectPortal();
onBeforeMount(() => {
isSSR = false;
});
onMounted(() => {
if (shouldRender.value) {
container = props.getContainer();
}
Expand Down
2 changes: 1 addition & 1 deletion components/config-provider/hooks/useConfigInject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default (name: string, props: Record<any, any>) => {
() => props.getTargetContainer ?? configProvider.getTargetContainer?.value,
);
const getPopupContainer = computed(
() => props.getPopupContainer ?? configProvider.getPopupContainer?.value,
() => props.getContainer ?? props.getPopupContainer ?? configProvider.getPopupContainer?.value,
);

const dropdownMatchSelectWidth = computed<boolean | number>(
Expand Down

0 comments on commit 2f7f0e6

Please sign in to comment.