mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-04-06 15:30:30 +08:00
chore(actions-core): Separated guard and if-else statement in ScrollTo action.
This commit is contained in:
parent
4f838cf0a1
commit
a03128fc26
@ -19,7 +19,8 @@ import { type } from '@lowdefy/helpers';
|
||||
function ScrollTo({ document, params, window }) {
|
||||
if (!type.isObject(params)) {
|
||||
throw new Error(`Invalid ScrollTo, check action params. Received "${JSON.stringify(params)}".`);
|
||||
} else if (params.blockId) {
|
||||
}
|
||||
if (params.blockId) {
|
||||
const element = document.getElementById(params.blockId);
|
||||
if (element) {
|
||||
element.scrollIntoView(params.options);
|
||||
|
Loading…
x
Reference in New Issue
Block a user