Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

domestique

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domestique - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

src/element/active-element.js

6

index.js

@@ -6,5 +6,8 @@ import inViewport from './src/dimension/in-viewport';

import activeElement from './src/element/active-element';
import create from './src/element/create';
import {addClass, hasClass, removeClass} from './src/element/class';
import data from './src/element/data';
import focus from './src/element/focus';
import parents from './src/element/parents';

@@ -29,2 +32,3 @@ import delegate from './src/event/delegate';

// Element
activeElement,
create,

@@ -35,2 +39,4 @@ addClass,

data,
focus,
parents,

@@ -37,0 +43,0 @@ // Event

14

package.json
{
"name": "domestique",
"version": "1.1.0",
"version": "1.2.0",
"description": "A modular DOM helper library.",

@@ -40,5 +40,13 @@ "repository": "https://github.com/jsor/domestique.git",

"ignores": [
"test/**",
"karma*"
"karma.conf.js"
],
"globals": [
"after",
"afterEach",
"assert",
"before",
"beforeEach",
"describe",
"it"
],
"envs": [

@@ -45,0 +53,0 @@ "node",

@@ -48,2 +48,3 @@ Domestique

// Element
activeElement,
create,

@@ -54,2 +55,4 @@ addClass,

data,
focus,
parents,

@@ -79,2 +82,3 @@ // Event

* [Element](#element)
* [activeElement()](#activeelement)
* [create()](#create)

@@ -85,2 +89,4 @@ * [addClass()](#addclass)

* [data()](#data)
* [focus()](#focus)
* [parents()](#parents)
* [Event](#event)

@@ -165,2 +171,16 @@ * [ready()](#ready)

#### activeElement()
```
activeElement(): Element
```
Returns the element that currently has focus.
##### Example
```javascript
const element = activeElement();
```
#### create()

@@ -260,2 +280,42 @@

#### focus()
```
focus(element: Element[, options: object]): void
```
Shifts focus to an element.
##### Example
```javascript
focus(element);
```
Browsers scroll the focused element into view. `focus()` provides an option
`restoreScrollPosition` to restore scroll positions of all scroll containers of
the focused element to the state before the element got focus.
##### Example
```javascript
focus(element, {
restoreScrollPosition: true
});
```
#### parents()
```
parents(element: Element): Array
```
Returns an array of the element's parent elements.
##### Example
```javascript
const parentElements = parents(element);
```
### Event

@@ -262,0 +322,0 @@

@@ -16,3 +16,3 @@ export default function dispatch(target, type, eventInit = {}) {

} catch (err) {
event = document.createEvent('Event');
event = document.createEvent('CustomEvent');
event.initCustomEvent(

@@ -19,0 +19,0 @@ type,

@@ -5,3 +5,3 @@ import optionsArgument from './options-argument';

if (!target || typeof target.removeEventListener !== 'function') {
return () => {};
return;
}

@@ -8,0 +8,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc