Skip to content

Change scrollIntoView functionality to support different block types #50

Description

@vinamrasareen

One of the steps needs to scroll to element and it does scroll to end but the highlight/backdrop is not displayed unless I resize browser or open/close inspect mode.

So instead of block: end as default, can we get to pass center or start

import {TourGuideClient} from "../Tour";

/**
 * scrollToTarget
 * @param tgInstance
 * @param targetElem
 */
const scrollToTarget = (tgInstance : TourGuideClient, targetElem : HTMLElement)=>{
    //TODO: detect when scroll complete instead of relying on timeout
    targetElem.scrollIntoView({behavior: tgInstance.options.autoScrollSmooth ? "smooth" : "auto", block: "end", inline: "nearest"});
}

export default scrollToTarget

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions