dialog-draggable
v0.1.5
Published
Makes HTML <dialog> draggable.
Downloads
250
Maintainers
Readme
Dialog-draggable
Makes the HTML element <dialog> draggable.
Quick start
Install
pnpm add dialog-draggable
# yarn add dialog-draggable
# npm i dialog-draggable
make <dialog>
draggable
import { makeDialogDraggable } from 'dialog-draggable';
makeDialogDraggable();
Trigger dragging by inner dom
add data-dialog-draggable
attribute to inner tags, so they can trigger the outer <dialog>
dragging. Notice
<button>
and <a>
tags are excluded.
<!-- Example -->
<dialog id="dialog">
<nav data-dialog-draggable>
Dialog title
<!-- buttons won't trigger dragging -->
<button type="button">X</button>
</nav>
<!-- dialog contents -->
</dialog>
Develop
pnpm install
local dev preview
pnpm dev
test
pnpm test
Supported by JetBrains open source program.