makeup-active-descendant
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -47,4 +47,6 @@ "use strict"; | ||
this._focusEl.setAttribute("aria-activedescendant", toItem.id); | ||
if (this._options.autoScroll && this._containerEl) { | ||
this._containerEl.scrollTop = toItem.offsetTop - this._containerEl.offsetHeight / 2; | ||
if (this._options.autoScroll && this._itemContainerEl) { | ||
toItem.scrollIntoView({ | ||
block: "center" | ||
}); | ||
} | ||
@@ -51,0 +53,0 @@ } |
@@ -47,4 +47,6 @@ "use strict"; | ||
this._focusEl.setAttribute("aria-activedescendant", toItem.id); | ||
if (this._options.autoScroll && this._containerEl) { | ||
this._containerEl.scrollTop = toItem.offsetTop - this._containerEl.offsetHeight / 2; | ||
if (this._options.autoScroll && this._itemContainerEl) { | ||
toItem.scrollIntoView({ | ||
block: "center" | ||
}); | ||
} | ||
@@ -51,0 +53,0 @@ } |
@@ -30,4 +30,4 @@ import * as NavigationEmitter from "makeup-navigation-emitter"; | ||
this._focusEl.setAttribute("aria-activedescendant", toItem.id); | ||
if (this._options.autoScroll && this._containerEl) { | ||
this._containerEl.scrollTop = toItem.offsetTop - this._containerEl.offsetHeight / 2; | ||
if (this._options.autoScroll && this._itemContainerEl) { | ||
toItem.scrollIntoView({ block: "center" }); | ||
} | ||
@@ -34,0 +34,0 @@ } |
{ | ||
"name": "makeup-active-descendant", | ||
"description": "Implements ARIA active descendant keyboard navigation", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"main": "./dist/cjs/index.js", | ||
@@ -40,3 +40,3 @@ "module": "./dist/mjs/index.js", | ||
], | ||
"gitHead": "65ded67f64b37dd58f7249e2073304f4604ae41a" | ||
"gitHead": "8e77815491c3edf766dc3ac98d74e7ee66c0c558" | ||
} |
467
26755