chore: 默认 affixOffsetTop 改成 0 (#2623)

* chore: sdk 默认 affixOffsetTop 改成 0

* chore: 默认 affixOffsetTop 改成 0
This commit is contained in:
吴多益 2021-09-28 20:32:52 +08:00 committed by GitHub
parent 1791ccae91
commit 608b86f4c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 5 deletions

View File

@ -81,8 +81,7 @@ class AMISComponent extends React.Component {
copy: content => { copy: content => {
copy(content); copy(content);
toast.success('内容已复制到粘贴板'); toast.success('内容已复制到粘贴板');
}, }
affixOffsetTop: 0
})} })}
</div> </div>
) : null; ) : null;

View File

@ -1,6 +1,6 @@
{ {
"name": "amis", "name": "amis",
"version": "1.2.4-beta.9", "version": "1.2.4-beta.15",
"description": "一种MIS页面生成工具", "description": "一种MIS页面生成工具",
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {

View File

@ -224,7 +224,7 @@ export function loadRenderer(schema: Schema, path: string) {
const defaultOptions: RenderOptions = { const defaultOptions: RenderOptions = {
session: 'global', session: 'global',
affixOffsetTop: 50, affixOffsetTop: 0,
affixOffsetBottom: 0, affixOffsetBottom: 0,
richTextToken: '', richTextToken: '',
loadRenderer, loadRenderer,

View File

@ -1110,7 +1110,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
if (autoJumpToTopOnPagerChange && this.control) { if (autoJumpToTopOnPagerChange && this.control) {
(findDOMNode(this.control) as HTMLElement).scrollIntoView(); (findDOMNode(this.control) as HTMLElement).scrollIntoView();
const scrolledY = window.scrollY; const scrolledY = window.scrollY;
const offsetTop = affixOffsetTop ?? env?.affixOffsetTop ?? 50; const offsetTop = affixOffsetTop ?? env?.affixOffsetTop ?? 0;
scrolledY && window.scroll(0, scrolledY - offsetTop); scrolledY && window.scroll(0, scrolledY - offsetTop);
} }
} }