
Company News
AWS Security Hub Adds Socket for Supply Chain Security
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.
@isoftdata/svelte-context-menu
Advanced tools
A Context/Dropdown menu component, filled with [DropdownItem](DropdownItem.md)s and [DropdownCheckboxItem](DropdownCheckboxItem.md)s
A Context/Dropdown menu component, filled with DropdownItems and DropdownCheckboxItems
npm i @isoftdata/svelte-context-menu
| Name | Type | Description | Default Value |
|---|---|---|---|
| id | string | The id of the context menu element. | "menu" |
| menuItemClickCloses | boolean | Whether clicking a menu item will close the menu. | true |
| placement | string | The placement of the context menu relative to the reference element. | "bottom-start" |
The main way you'll interact with this component is through calling the methods below. To access these methods on the component instance, you will have to use the bind:this directive on the ContextMenu in your template, and assign it to a variable, which you can then call the methods on. See Example for more details.
event - the mouse eventtargetId (optional) the id of an element. If supplied, the menu will be positioned relative to this element. Otherwise, it will be positioned relative to the cursor.<script lang="ts">
import ContextMenu from '@isoftdata/svelte-context-menu'
let cm: ContextMenu
</script>
<button
id="target"
class="btn btn-primary btn-block"
on:contextmenu={e => {
event.preventDefault()
cm.open(e, "target")
}}
>
Right Click to Open Menu
</button>
<ContextMenu bind:this={cm}>
<DropdownItem
icon="mouse"
onclick={() => alert("Dropdown Item Clicked!")}
>
Click Me!
</DropdownItem>
<div class="downdown-divider" />
<h6 class="dropdown-header">Clicked {cmClicks} time(s)</h6>
</ContextMenu>
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.

Research
/Security News
Popular npm packages keyv and cacheable compromised.

Security News
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.