Skip to content

Commit

Permalink
Fix some more element definition issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonmade committed Sep 16, 2024
1 parent 26d3eca commit ba5df0c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/swift-kangaroos-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@watching/clips-preact': patch
'@watching/clips-react': patch
'@watching/clips': patch
---

Fix some more element definition issues
5 changes: 3 additions & 2 deletions packages/clips-preact/source/components/Action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ declare module 'preact' {
}
}

export function Action({overlay, onPress, ...props}: ActionProps) {
export function Action({overlay, children, onPress, ...props}: ActionProps) {
return (
<ui-action
{...props}
onpress={onPress ? (event) => event.respondWith(onPress()) : undefined}
{...props}
>
{children}
{overlay && isValidElement(overlay)
? cloneElement(overlay, {slot: 'overlay'})
: null}
Expand Down
3 changes: 2 additions & 1 deletion packages/clips-react/source/components/Action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ declare module 'react' {
}

export const Action = forwardRef<ActionElement, ActionProps>(function Action(
{overlay, onPress, ...props},
{overlay, children, onPress, ...props},
ref,
) {
return (
Expand All @@ -39,6 +39,7 @@ export const Action = forwardRef<ActionElement, ActionProps>(function Action(
{...props}
onpress={onPress ? (event) => event.respondWith(onPress()) : undefined}
>
{children}
{overlay && isValidElement(overlay)
? cloneElement<any>(overlay, {slot: 'overlay'})
: null}
Expand Down
2 changes: 2 additions & 0 deletions packages/clips/source/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
} from './extension-points.ts';
import {acceptSignals} from './signals.ts';

import './elements.ts';

customElements.define('remote-root', RemoteRootElement);
customElements.define('remote-fragment', RemoteFragmentElement);

Expand Down

0 comments on commit ba5df0c

Please sign in to comment.