Skip to content

Provide ability to specify parent container #13

@danhyun

Description

@danhyun

Firstly thanks for this amazing lib, I was looking for a nice non bootstrap solution and this fit the bill.

As I was implementing this lib I noticed that the change event wasn't being fired and after some debugging I've found that the offsetIndex is being determined based on the element's direct parent offset.

In my structure my header elements are nested two levels deep. It would be as we're calculating the offset for each element if we can take into account all parent elements until we hit the main container.

https://github.com/gajus/contents/blob/master/src/contents.js#L477

That way our offset index will be more reliable.

Thanks again.

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