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

feat: Add option to shadow render content of popover even when not open #673

Closed
ieedan opened this issue Sep 24, 2024 · 2 comments · May be fixed by #469
Closed

feat: Add option to shadow render content of popover even when not open #673

ieedan opened this issue Sep 24, 2024 · 2 comments · May be fixed by #469
Labels
Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5.

Comments

@ieedan
Copy link

ieedan commented Sep 24, 2024

Describe the feature in detail (code, mocks, or screenshots encouraged)

Basically I am running into an issue when I have options in a Popover that need to be initialized for the rest of the component to work.

It may be nice to have an option to render the content of a Popover/DropdownMenu etc. even if the menu is not open. This would be breaking so maybe it shouldn't be on by default. It could be called something like alwaysRender.

packages/bits-ui/src/lib/bits/popover/components/popover-content.svelte:

<!-- snip line 94 -->
{:else if $open}
	<div bind:this={el} use:melt={builder} {...$$restProps}>
		<slot {builder} />
	</div>
{:else if !$open && alwaysRender}
    <!-- add `display: none;` or another method to render content without showing it -->
    <div bind:this={el} use:melt={builder} {...$$restProps} style="display: none;">
		<slot {builder} />
    </div>
{/if}

What type of pull request would this be?

Enhancement

Provide relevant links or additional information.

For example I have context initialized at the root of a component. Then a popover containing its opions. Each option needs to check if its already selected to set an enabled at the root of the component. In this case enabled will not be set until the options have been rendered and popover has not rendered them until the user opens the menu.

@huntabyte huntabyte added the Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5. label Sep 24, 2024
@huntabyte huntabyte mentioned this issue Sep 24, 2024
4 tasks
@huntabyte
Copy link
Owner

Closing as fixed in bits-ui@next

@ieedan
Copy link
Author

ieedan commented Oct 3, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants