Popper for Svelte with actions, no wrapper components required!
MIT License
Bot releases are visible (Hide)
Published by bryanmylee almost 4 years ago
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.