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

First-Use Challenges #2

Open
djamez opened this issue Jan 28, 2024 · 0 comments
Open

First-Use Challenges #2

djamez opened this issue Jan 28, 2024 · 0 comments

Comments

@djamez
Copy link

djamez commented Jan 28, 2024

Hello. Thank you for a very comprehensive and potentially easy-to-use Popover package for Svelte.

In attempting to use the component ("svelte": "^4.2.7"), I have encountered some challenges:

  • a) vite-plugin-svelte warning: Upon executing npm run dev, the following warning is emitted:
[vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

[email protected]

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.
  • b) Usability: With the following code:
<script lang="ts">
  import { Popover } from 'svelte-smooth-popover';
  import { browser } from '$app/environment';
  $: open = false;
</script>

<button>
  Example
  <Popover
    align="top-center"
    {open}
    showOnClick={true}
    borderRadius={10}
    caretWidth={7}
    offset={10}
    caretCurveAmount={1}
    caretCurveTopAngle={-15}
    caretCurveTopStrength={0.33}
    caretCurveBottomAngle={15}
    caretCurveBottomStrength={0.66}
    alignAnchor="auto"
  >
    <div
      style="border-radius: 10px;"
      class="flex min-w-[200px] items-center justify-center bg-slate-400 p-10 text-black"
    >
      <button class="rounded-md bg-cyan-700 px-2 text-sm text-white" on:click={() => (open = false)}>
                 Done
            </button>
    </div>
  </Popover>
</button>
  1. The caret does not display
  2. I cannot close the Popover programmatically even when I make the open prop reactive (as in the button inside the div)

Is there something that I am missing?

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

1 participant