Skip to content

The getTargetContainer attribute of config-provider has no effect on Affix #6123

@lyh1995

Description

@lyh1995
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.14

Environment

ant-design-vue@3.2.14; vue@3.2.41

Reproduction link

Edit on CodeSandbox

Steps to reproduce

使用config-provider组件的getTargetContainer属性配置Affix组件和Anchor组件的滚动监听容器

What is expected?

Affix组件和Anchor组件的滚动容器都为config-provider的getTargetContainer属性所设置的容器

What is actually happening?

config-provider的getTargetContainer配置对Anchor组件生效了,对Affix组件没生效


查看源码,发现Affix组件并没有用useConfigInject从config-provider获取getTargetContainer,而是直接使用了props里的target

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions