scroll-into-view / scroll-into-view-if-needed

Element.scrollIntoView ponyfills for things like "if-needed" and "smooth"

Home Page:https://scroll-into-view.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not scroll to element in iframe outside viewport

92thunder opened this issue · comments

I fixed scrollable if hidden by frame, but does not work scroll if iframe is outside viewport.
It seems that it is supported in native, so I think it should be supported.

@stipsan I have two ideas.

  • Returns frames[] traversed above iframe by compute-scroll-into-view.
  • If target is in iframe, recursively run behavior by scroll-into-view-if-needed.

I think the latter is better because the responsibilities are clear, but what about?

  • Returns frames[] traversed above iframe by compute-scroll-into-view.
  • If target is in iframe, recursively run behavior by scroll-into-view-if-needed.

After all, I fixed it with the above method.
Because, latter method is can't centering target if compute iframe as target.