Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code sandbox liquid tag w/ focus input causes scrolling on page load #2290

Closed
jessleenyc opened this issue Apr 2, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@jessleenyc
Copy link
Collaborator

commented Apr 2, 2019

Describe the bug
Reported by a user trying to embed a codesandbox that focuses an input. The page 'jumps'/scrolls to the embed when it loads.

To Reproduce
Create a new post w/ this liquid tag: {% codesandbox pyqq0o9mk7 %}. Make sure it appears below the fold so you can see the jump.

Expected behavior
Liquid Tag shouldn't cause scrolling on page load.

@benhalpern

This comment has been minimized.

Copy link
Collaborator

commented Apr 3, 2019

Is there anything we can do with iframe attributes to turn this off?

@mariocsee

This comment has been minimized.

Copy link
Collaborator

commented Apr 9, 2019

In the CodeSandbox documentation, there's an option runonclick that the user will have to add to prevent the jump (by not loading the codesandbox until the article reader decides to).

The codesandbox liquid tag doesn't support runonclick, but extending the regex query to accept runonclick in the valid_option method in codesandbox_tag.rb should do the trick. How does this workaround sound?

@mariocsee mariocsee referenced this issue Apr 11, 2019

Merged

allow codesandbox to accept runonclick #2381

2 of 2 tasks complete
@maestromac

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2019

Resolved with #2381

@maestromac maestromac closed this May 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.