Skip to content

Releases: bryanmylee/svelte-popperjs

Access the popper instance when creating popper actions!

20 Dec 10:43
a4a2718
Compare
Choose a tag to compare

If access is needed to the raw Popper instance created by the actions, you can reference the third element returned by createPopperActions. The third element is a function that will return the current Popper instance used by the actions.

Using the raw Popper instance to manually recompute the popper's position.

<script>
  import { createPopperActions } from 'svelte-popperjs';
  const [popperRef, popperContent, getInstance] = createPopperActions();
  
  async function refreshTooltip() {
    const newState = await getInstance().update();
  }
</script>

Tests were also added to ensure that no lifecycle leaks occur.