💥 fix(popup-window): astal thinks onClickedOutside prop is a Widget.Window signal

just separated window props from popup-window props
This commit is contained in:
retrozinndev
2025-06-12 21:38:32 -03:00
parent 23a2881810
commit 534ae23243
+7 -1
View File
@@ -45,8 +45,14 @@ export function PopupWindow(props: PopupWindowProps): Widget.Window {
css: props.cssBackgroundWindow, css: props.cssBackgroundWindow,
}) : undefined; }) : undefined;
const winProps: Widget.WindowProps = {};
for(const key of Object.keys(props).filter(k => k !== "onClickedOutside")) {
// @ts-ignore ignore the `onClickedOutside()` method because astal thinks it's a signal
winProps[key as keyof typeof winProps] = props[key as keyof typeof props];
}
return new Widget.Window({ return new Widget.Window({
...props, ...winProps,
namespace: props?.namespace ?? "popup-window", namespace: props?.namespace ?? "popup-window",
className: `popup-window ${(props.namespace instanceof Binding ? className: `popup-window ${(props.namespace instanceof Binding ?
props.namespace.get() : props.namespace) || ""}`, props.namespace.get() : props.namespace) || ""}`,