mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-03-13 14:56:54 +08:00
fix(actions-core): Updated ScrollTo action to include param error handling.
This commit is contained in:
parent
27838bcf75
commit
25b656f115
@ -14,8 +14,12 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { type } from '@lowdefy/helpers';
|
||||
|
||||
function ScrollTo({ document, params, window }) {
|
||||
if (params.blockId) {
|
||||
if (!type.isObject(params)) {
|
||||
throw new Error(`Invalid ScrollTo, check action params. Received "${JSON.stringify(params)}".`);
|
||||
} else if (params.blockId) {
|
||||
const element = document.getElementById(params.blockId);
|
||||
if (element) {
|
||||
element.scrollIntoView(params.options);
|
||||
|
Loading…
x
Reference in New Issue
Block a user