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

v3 - Disabled prop for Popovers & modals #3120

Open
doolijb opened this issue Jan 17, 2025 · 2 comments
Open

v3 - Disabled prop for Popovers & modals #3120

doolijb opened this issue Jan 17, 2025 · 2 comments
Assignees
Labels
feature request Request a feature or introduce and update to the project.
Milestone

Comments

@doolijb
Copy link

doolijb commented Jan 17, 2025

Maybe I'm just not seeing it, but I believe popups/modals trigger need a disabled: boolean prop at the component or snippet level.

Being that the new modals and popovers are most comfortable to implement with {#snippet trigger()}, we need a convenient way to disable onclick.

Proposal A

<script lang="ts">
  import { Modal } from '@skeletonlabs/skeleton-svelte'

  let open= $state(false)
  let triggerDisabled = $state(true)
</script>

<Modal
  bind:open
  {triggerDisabled}
>
  {#snippet trigger()}
    <span> Click me! </span>
  {/snippet}
  {#snippet content()}
    <!-- Content -->
  {/snippet}
</Modal>

Proposal B

<script lang="ts">
  import { Modal } from '@skeletonlabs/skeleton-svelte'

  let open= $state(false)
  let triggerDisabled = $state(true)
</script>

<Modal
  bind:open
>
  {#snippet trigger({disabled: triggerDisabled)}
    <span> Click me! </span>
  {/snippet}
  {#snippet content()}
    <!-- Content -->
  {/snippet}
</Modal>

What type of pull request would this be?

Enhancement

Provide relevant links or additional information.

No response

@doolijb doolijb added the feature request Request a feature or introduce and update to the project. label Jan 17, 2025
@endigo9740 endigo9740 added this to the Future Updates milestone Jan 17, 2025
@phamduylong
Copy link
Contributor

@endigo9740 I'm into this as well. Unsure how the React side looks with all the Floating UI stuff but I can craft this up for Svelte at least.

@endigo9740
Copy link
Contributor

endigo9740 commented Jan 30, 2025

@phamduylong assigning now.

Per the request:

  • let's opt for something closer to Proposal A
  • Let's keep the prop simple like disabled
  • When this is set the disabled state on the trigger button should be set.
  • Let's consider adding this for all 4 types of Popover components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a feature or introduce and update to the project.
Projects
None yet
Development

No branches or pull requests

3 participants