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

Props are not passed to PaneForge in Resizable.Handle #1267

Closed
SeifKaroui opened this issue Sep 11, 2024 · 1 comment · May be fixed by #1182
Closed

Props are not passed to PaneForge in Resizable.Handle #1267

SeifKaroui opened this issue Sep 11, 2024 · 1 comment · May be fixed by #1182

Comments

@SeifKaroui
Copy link

Describe the bug

When using Resizable.Handle, I can't use PaneForge props and abilities like "disabled" and "onDraggingChange" as they are not passed to PaneForge's primitive component.

Reproduction

Example with the PaneForge "disabled" prop
Expected Behaviour: handle should be disabled but its not

<script>
	import * as Resizable from '$lib/components/ui/resizable';
</script>

<Resizable.PaneGroup direction="vertical">
	<Resizable.Pane></Resizable.Pane>
	<Resizable.Handle withHandle disabled={true} />
	<Resizable.Pane></Resizable.Pane>
</Resizable.PaneGroup>

Adding {...$$restProps} fixes the problem for me:
Modified ResizbleHandle source code

<ResizablePrimitive.PaneResizer
	bind:el
	class={cn(
		'bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90',
		className
	)}
	{...$$restProps}
>
	{#if withHandle}
		<div class="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border">
			<GripVertical class="h-2.5 w-2.5" />
		</div>
	{/if}
</ResizablePrimitive.PaneResizer>

Logs

No response

System Info

Linux, Firefox

Severity

annoyance

@SeifKaroui SeifKaroui changed the title Props are not passed to PageForge in Resizable.Handle Props are not passed to PaneForge in Resizable.Handle Sep 15, 2024
@huntabyte huntabyte mentioned this issue Sep 28, 2024
3 tasks
@huntabyte
Copy link
Owner

Closed in shadcn-svelte@next

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

Successfully merging a pull request may close this issue.

2 participants