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

<turbo-cable-stream-source> tag can affect visual layout #643

Open
jordan-brough opened this issue Jul 3, 2024 · 1 comment
Open

<turbo-cable-stream-source> tag can affect visual layout #643

jordan-brough opened this issue Jul 3, 2024 · 1 comment

Comments

@jordan-brough
Copy link

jordan-brough commented Jul 3, 2024

A <turbo-cable-stream-source> element can mess up layout depending on where it's placed. This only happens in certain situations but it feels unexpected when it does happen.

It seems like this shouldn't be the default behavior for a Rails app?
Should it be hidden via display: none, or some other solution?

For example, this code:

<style>
.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.grid-item {
  background-color: lightblue;
}
</style>

<div class="grid-container">
  <div class="grid-item">Item 1</div>
  <div class="grid-item">Item 2</div>
  <turbo-cable-stream-source></turbo-cable-stream-source>
  <div class="grid-item">Item 3</div>
  <div class="grid-item">Item 4</div>
</div>

produces this result:
image

See this jsfiddle.

@jordan-brough
Copy link
Author

Someone opened a PR earlier this year with a potential solution for this issue here: #557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant