google / google/playground-elements

Problem to show file content when using more than one file and custom layout

Open
#384 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
648
Forks
61
PR merge metrics
No merged PRs in 30d

Description

Hi there!
I'm using a custom layout based on this example https://github.com/google/playground-elements#custom-layouts.

Since I need to use more than one file I added `playground-tab-bar` component, which is rendered ok. The problem arise when I want to select another file: the new content is not rendered/updated into `playground-file-editor`.

Here is my code.
```html

<!doctype html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="styles.css">
</head>
<body>
<section class="o-container one ">
<ul class="o-orbit">
<li class="o-orbiter"></li>
<li class="o-orbiter"></li>
<li class="o-orbiter"></li>
<li class="o-orbiter"></li>
<li class="o-orbiter"></li>
</ul>
</section>
</body>

.o-orbiter {
border: 7px solid mediumaquamarine;
}
.o-container {
border: 0.2px solid gray;
}
.one {
border: 2px solid;
padding: 20px;
}






```

And css style:

```css
.example {
width: 100%;
border: 1px solid #ccc;
overflow: hidden;
border-radius: 10px;
}
.example > playground-file-editor {
height: 300px;
}
.example > playground-preview {
height: max-content;
border-top: 1px solid #ccc;
--playground-preview-toolbar-background: #eaeaea;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.