{"id":16401385,"url":"https://github.com/thearnica/dom-locky","last_synced_at":"2025-03-21T02:33:07.969Z","repository":{"id":57214699,"uuid":"140929640","full_name":"thearnica/dom-locky","owner":"thearnica","description":"🙈🙉🙊 - the best way to scope a scroll, or literally any other event.","archived":false,"fork":false,"pushed_at":"2020-09-16T05:28:43.000Z","size":191,"stargazers_count":21,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-12T05:30:51.805Z","etag":null,"topics":["dom-api","events","inert","scroll"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thearnica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-14T08:26:12.000Z","updated_at":"2024-03-22T03:56:24.000Z","dependencies_parsed_at":"2022-08-26T13:41:25.799Z","dependency_job_id":null,"html_url":"https://github.com/thearnica/dom-locky","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearnica%2Fdom-locky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearnica%2Fdom-locky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearnica%2Fdom-locky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearnica%2Fdom-locky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thearnica","download_url":"https://codeload.github.com/thearnica/dom-locky/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221811380,"owners_count":16884305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dom-api","events","inert","scroll"],"created_at":"2024-10-11T05:30:17.810Z","updated_at":"2024-10-28T09:12:13.123Z","avatar_url":"https://github.com/thearnica.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dom-locky \n[![CircleCI status](https://img.shields.io/circleci/project/github/thearnica/dom-locky/master.svg?style=flat-square)](https://circleci.com/gh/thearnica/dom-locky/tree/master)\n[![Greenkeeper badge](https://badges.greenkeeper.io/thearnica/dom-locky.svg)](https://greenkeeper.io/)\n[![npm](https://img.shields.io/npm/v/dom-locky.svg)](https://www.npmjs.com/package/dom-locky)\n----\n\n[![NPM](https://nodei.co/npm/dom-locky.png?downloads=true\u0026stars=true)](https://nodei.co/npm/dom-locky/)\n\n🙈Loki  - is God of Mischief, Madness and Evil!\n\n🙉Locky - is God of Locks, Event capturing and Stealing. Small and very slender brother - just 1kb.\n\n🙊Locky will never let event escape the target node, will prevent scrolls outside, will do the HTML5 `inert` job.\n\nLocky will completely disable any user iterations outside of nested children.\n\nAnd it has a twin-brother - [react-locky](https://github.com/theKashey/react-locky)\n```js\nimport {lockyOn} from 'dom-locky';\n\nconst unlock = lockyOn('.modal', extraProps);\nconst unlock = lockyOn(myElement, { onEscape: callback });\n//......\nunlock();\n```\n\n# Unpkg\n You may also include this library from unpkg as [https://unpkg.com/dom-locky](https://unpkg.com/dom-locky).\n Then locky will be available as `locky` global variable.\n\n# API\n Locky accepts selector or HTMLElement as a first argument, and locky will be activated only on the first element matching selector\n Locky accepts a settings as a second argument\n - onEscape, will be triggered when someone will try \"escape\" the lock. See \"report\" events below\n - noDefault[=false], disables all \"default\" events\n - events[=defaultEvents], DOM events to manage\n - group[=null], focus group id. Locks with the same group will not block each other.\n \n# Default events\n - click: 'report' (will call `onEscape`)\n - mousemove: true,\n - mousedown: 'report' (will call `onEscape`)\n - touchmove: true,\n - touchstart: 'report' (will call `onEscape`)\n - keydown: true,\n - focus: false, (focus is unblockable)\n - change: false,\n - scroll: true, (scroll is handled separately)\n - wheel: true, \n \n# Focus\n Locky could not propely handle __focus__ events, and will let it get out of the form, and will block attemps to return it, as long they will have source out of the lock.\n To scope a focus use [dom-focus-lock](https://github.com/theKashey/dom-focus-lock)\n \n# Tip\n__important__ tip for __Mobile Safary__ - while normal \"touch move\" will\nscroll \"scrollable\" container, touch+move started on inputs will start\n__drag-n-drop__ and cause whole layer(modal/page) scroll. \n(it will just scroll as a 💩, or not scroll at all).\n\nTo disable this behavior - apply ` -webkit-overflow-scrolling: touch;` on the page.\n \n# Licence\n MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthearnica%2Fdom-locky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthearnica%2Fdom-locky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthearnica%2Fdom-locky/lists"}