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

[bug] SolidJs windowControlsProps is not reactive #27

Open
Eatham532 opened this issue Apr 22, 2024 · 1 comment
Open

[bug] SolidJs windowControlsProps is not reactive #27

Eatham532 opened this issue Apr 22, 2024 · 1 comment

Comments

@Eatham532
Copy link

I try to use a SolidJs signal with my titlebar to make the controls hidden and not hidden. However, when I update the signal the taskbar doesn't update.

Code:
<WindowTitlebar class={'titlebar'} windowControlsProps={{"hide":getHide()}}></WindowTitlebar>

@Rafferty97
Copy link

Here's some insight into what's happening. When you pass { "hide": gethide() } to a prop, you are not passing an object with reactive properties. Instead, Solid.JS will reconstruct the entire { hide: boolean } object any time getHide changes, and pass this to WindowTitlebar. This should work, but due to a bug in WindowTitlebar, it doesn't. It's also potentially less efficient.

Here's a workaround that might work:

<WindowTitlebar class="titlebar" windowControlsProps={{ get hide() { return getHide() } }} />

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

No branches or pull requests

2 participants