Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sticky] scroll-view设定高度后,sticky无法吸顶 #2402

Open
vicorn opened this issue Oct 19, 2023 · 3 comments
Open

[Sticky] scroll-view设定高度后,sticky无法吸顶 #2402

vicorn opened this issue Oct 19, 2023 · 3 comments

Comments

@vicorn
Copy link

vicorn commented Oct 19, 2023

tdesign-miniprogram 版本

1.2.3

重现链接

No response

重现步骤

代码如下

<view>
  <scroll-view scroll-y
    style="height:300px;background-color: gray;">
    <view style="height:2000px">
      <view style="height: 200px;"></view>
      <t-sticky offset-top="{{ 100 }}">
        <t-dropdown-menu>
          <t-dropdown-item label="筛选"
            bindchange="onChange">
            <t-tree-select options="{{options}}"
              value="{{value}}"
              bind:change="onChange" />
          </t-dropdown-item>
          <t-dropdown-item label="全部" />
        </t-dropdown-menu>
      </t-sticky>
    </view>
  </scroll-view>
</view>

期望结果

能够在scroll-view布局中吸顶

实际结果

无法触发吸顶效果

基础库版本

No response

补充说明

No response

@github-actions
Copy link
Contributor

👋 @vicorn,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@Delevin888
Copy link

我这么解决的,在scroll-view上bind scroll ,然后在函数里面调用 组件内部方法。

const groupSticky = this.selectComponent('#groupSticky');
groupSticky.onScroll(e.detail);

@TyinOne
Copy link

TyinOne commented Mar 21, 2024

我这么解决的,在scroll-view上bind scroll ,然后在函数里面调用 组件内部方法。

const groupSticky = this.selectComponent('#groupSticky');
groupSticky.onScroll(e.detail);

这个确实可以解决普通的Sticky组件吸顶问题,但是我Tabs组件里的吸顶不行哎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants