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

dropmic

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dropmic - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

12

dist/dropmic.js

@@ -62,3 +62,3 @@ "use strict";

this.target.addEventListener("keydown", function (event) {
if (event.key === "Escape") {
if (event.keyCode === 27) {
self.close();

@@ -74,3 +74,3 @@ self.btn.focus();

var elementLast = elementList.length - 1;
if (event.key === "Tab" && document.activeElement === elementList[elementLast]) {
if (event.keyCode === 9 && document.activeElement === elementList[elementLast]) {
event.preventDefault();

@@ -81,3 +81,3 @@ elementList[0].focus();

// Arrow Up/Down navigation
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
if (event.keyCode === 38 || event.keyCode === 40) {
event.preventDefault();

@@ -88,3 +88,3 @@ var currentItemIndex = self._getCurrentItemIndex(elementList, document.activeElement);

} else {
if (event.key === "ArrowUp") {
if (event.keyCode === 38) {
elementList[self._getPreviousItemIndex(elementList, currentItemIndex)].focus();

@@ -231,4 +231,4 @@ } else {

this._constructList().appendChild(this._constructItem(btn));
btn.addEventListener('click', function () {
callback();
btn.addEventListener('click', function (event) {
callback(event);
});

@@ -235,0 +235,0 @@ return btn;

{
"name": "dropmic",
"version": "0.2.1",
"version": "0.2.2",
"description": "A lightweight dropdown plugin",

@@ -5,0 +5,0 @@ "main": "dist/dropmic.js",

@@ -50,3 +50,3 @@ const dropmicClassShow = "dropmic--show";

this.target.addEventListener("keydown", function(event) {
if(event.key === "Escape") {
if(event.keyCode === 27) {
self.close();

@@ -63,3 +63,3 @@ self.btn.focus();

let elementLast = elementList.length - 1;
if(event.key === "Tab" && document.activeElement === elementList[elementLast]) {
if(event.keyCode === 9 && document.activeElement === elementList[elementLast]) {
event.preventDefault();

@@ -70,3 +70,3 @@ elementList[0].focus();

// Arrow Up/Down navigation
if(event.key === "ArrowUp" || event.key === "ArrowDown") {
if(event.keyCode === 38 || event.keyCode === 40) {
event.preventDefault();

@@ -77,3 +77,3 @@ let currentItemIndex = self._getCurrentItemIndex(elementList, document.activeElement);

} else {
if(event.key === "ArrowUp") {
if(event.keyCode === 38) {
elementList[self._getPreviousItemIndex(elementList, currentItemIndex)].focus();

@@ -80,0 +80,0 @@ } else {

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