Skip to content

Commit ec7d93d

Browse files
authored
fix(PullDownRefresh): added usingCustomNavbar property to resolve conflicts when used with t-navbar (#3394)
1 parent 67a8d25 commit ec7d93d

File tree

9 files changed

+23
-2
lines changed

9 files changed

+23
-2
lines changed

src/pull-down-refresh/README.en-US.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ refresh-timeout | Number | 3000 | \- | N
2121
scroll-into-view | String | - | `1.1.5` | N
2222
show-scrollbar | Boolean | true | \- | N
2323
upper-threshold | String / Number | 50 | `1.1.5` | N
24+
using-custom-navbar | Boolean | false | \- | N
2425
value | Boolean | false | \- | N
2526
default-value | Boolean | undefined | uncontrolled property | N
2627

@@ -35,6 +36,7 @@ dragstart | `(scrollTop: number, scrollLeft: number)` | `1.2.10`
3536
refresh | \- | \-
3637
scrolltolower | \- | \-
3738
timeout | \- | \-
39+
3840
### PullDownRefresh External Classes
3941

4042
className | Description

src/pull-down-refresh/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ refresh-timeout | Number | 3000 | 刷新超时时间 | N
5454
scroll-into-view | String | - | `1.1.5`。值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素 | N
5555
show-scrollbar | Boolean | true | 滚动条显隐控制 (同时开启 enhanced 属性后生效) | N
5656
upper-threshold | String / Number | 50 | `1.1.5`。距顶部/左边多远时,触发 scrolltoupper 事件 | N
57+
using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
5758
value | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态 | N
5859
default-value | Boolean | undefined | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态。非受控属性 | N
5960

@@ -68,6 +69,7 @@ dragstart | `(scrollTop: number, scrollLeft: number)` | `1.2.10`。滑动开始
6869
refresh | \- | 结束下拉时触发
6970
scrolltolower | \- | 滚动到页面底部时触发
7071
timeout | \- | 刷新超时触发
72+
7173
### PullDownRefresh External Classes
7274

7375
类名 | 描述

src/pull-down-refresh/__test__/__snapshots__/demo.test.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ exports[`PullDownRefresh PullDownRefresh base demo works fine 1`] = `
1111
"刷新完成",
1212
]
1313
}}"
14+
usingCustomNavbar="{{true}}"
1415
value="{{true}}"
1516
bind:refresh="onRefresh"
1617
bind:scroll="onScroll"

src/pull-down-refresh/_example/base/index.wxml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<t-pull-down-refresh
22
value="{{enable}}"
33
loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}"
4+
usingCustomNavbar
45
bind:refresh="onRefresh"
56
bind:scroll="onScroll"
67
>

src/pull-down-refresh/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ const props: TdPullDownRefreshProps = {
6969
type: null,
7070
value: 50,
7171
},
72+
/** 是否使用了自定义导航栏 */
73+
usingCustomNavbar: {
74+
type: Boolean,
75+
value: false,
76+
},
7277
/** 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态 */
7378
value: {
7479
type: Boolean,

src/pull-down-refresh/pull-down-refresh.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
.@{prefix}-pull-down-refresh {
66
overflow: hidden;
7-
max-height: 100vh;
87
height: 100%;
98

109
&__track {

src/pull-down-refresh/pull-down-refresh.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/ind
22
import config from '../common/config';
33
import props from './props';
44
import { unitConvert, systemInfo } from '../common/utils';
5+
import useCustomNavbar from '../mixins/using-custom-navbar';
56

67
const { prefix } = config;
78
const name = `${prefix}-pull-down-refresh`;
@@ -38,6 +39,8 @@ export default class PullDownRefresh extends SuperComponent {
3839

3940
properties = props;
4041

42+
behaviors = [useCustomNavbar];
43+
4144
data = {
4245
prefix,
4346
classPrefix: name,

src/pull-down-refresh/pull-down-refresh.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<wxs src="../common/utils.wxs" module="_" />
22

33
<scroll-view
4-
style="{{_._style([style, customStyle])}}"
4+
style="{{_._style([style, customStyle, 'max-height: calc(100vh - ' + distanceTop + 'px)'])}}"
55
class="{{classPrefix}} class {{prefix}}-class"
66
type="list"
77
scroll-top="{{scrollTop}}"

src/pull-down-refresh/type.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ export interface TdPullDownRefreshProps {
109109
type: null;
110110
value?: string | number;
111111
};
112+
/**
113+
* 是否使用了自定义导航栏
114+
* @default false
115+
*/
116+
usingCustomNavbar?: {
117+
type: BooleanConstructor;
118+
value?: boolean;
119+
};
112120
/**
113121
* 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态
114122
* @default false

0 commit comments

Comments
 (0)