Skip to content

Commit f6f5c73

Browse files
authored
Merge pull request #15 from script-development/fix/toast-container-fragment
fix(toast): wrap container in single root element
2 parents 46427dd + 1d8d382 commit f6f5c73

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

packages/toast/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# @script-development/fs-toast
2+
3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- Fix ToastContainerComponent rendering a fragment instead of a single root element. Vue drops fallthrough attributes on fragment components, so positioning classes applied directly on `<component :is="ToastContainerComponent" />` were silently lost. The container now wraps toasts in a `<div>`, enabling proper attribute inheritance.

packages/toast/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@script-development/fs-toast",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Component-agnostic toast queue service for Vue 3 — FIFO management, you bring the component",
55
"license": "UNLICENSED",
66
"repository": {

packages/toast/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ export const createToastService = <C extends Component>(
5454
const ToastContainerComponent = defineComponent({
5555
name: "ToastContainer",
5656
render() {
57-
return toasts.value.map((toast) => toast.node);
57+
return h(
58+
"div",
59+
null,
60+
toasts.value.map((toast) => toast.node),
61+
);
5862
},
5963
});
6064

0 commit comments

Comments
 (0)