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
Closed
Labels
area: publishing experience issues related to an authors experience publishing. Tags, series, etc. bug always open for contribution external contributors welcome contribution is welcome!

Comments

@jessleenyc
Copy link
Contributor

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.

@jessleenyc jessleenyc added bug always open for contribution area: publishing experience issues related to an authors experience publishing. Tags, series, etc. external contributors welcome contribution is welcome! labels Apr 2, 2019
@benhalpern
Copy link
Contributor

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

@mariocsee
Copy link
Contributor

mariocsee 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?

@maestromac
Copy link
Member

Resolved with #2381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: publishing experience issues related to an authors experience publishing. Tags, series, etc. bug always open for contribution external contributors welcome contribution is welcome!
Projects
None yet
Development

No branches or pull requests

4 participants