diff --git a/package-lock.json b/package-lock.json index 4151343a..67608f09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nightTab", - "version": "6.1.0", + "version": "6.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 77e2f28f..f2f992c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nightTab", - "version": "6.1.0", + "version": "6.1.1", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "main": "index.js", "scripts": { diff --git a/src/js/auto-suggest.js b/src/js/auto-suggest.js index 9e1a8e17..d8561512 100644 --- a/src/js/auto-suggest.js +++ b/src/js/auto-suggest.js @@ -52,6 +52,7 @@ var autoSuggest = (function() { var elementToFocus = null; var focusIndex = null; var allSuggestItems = helper.eA(".auto-suggest-item"); + var columnCount = getComputedStyle(helper.e(".auto-suggest-list")).getPropertyValue("grid-template-columns").split(" ").length; var _findInput = function() { if (event.target.classList.contains("auto-suggest-input")) { _currentInputOptions.input = event.target; @@ -71,8 +72,8 @@ var autoSuggest = (function() { if (focusIndex == null) { elementToFocus = allSuggestItems[allSuggestItems.length - 1]; } else { - if (focusIndex > 2 && focusIndex <= allSuggestItems.length - 1) { - elementToFocus = allSuggestItems[focusIndex - 3]; + if (focusIndex >= columnCount && focusIndex <= allSuggestItems.length - 1) { + elementToFocus = allSuggestItems[focusIndex - columnCount]; } else { elementToFocus = _currentInputOptions.input; }; @@ -84,8 +85,8 @@ var autoSuggest = (function() { if (focusIndex == null) { elementToFocus = allSuggestItems[0]; } else { - if (focusIndex < allSuggestItems.length - 3) { - elementToFocus = allSuggestItems[focusIndex + 3]; + if (focusIndex < allSuggestItems.length - columnCount) { + elementToFocus = allSuggestItems[focusIndex + columnCount]; } else { elementToFocus = _currentInputOptions.input; }; diff --git a/src/js/version.js b/src/js/version.js index e3872643..b629fddf 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -1,6 +1,6 @@ var version = (function() { - var current = "6.1.0"; + var current = "6.1.1"; var name = "Jaded Raven"; diff --git a/src/manifest.json b/src/manifest.json index d8a426c7..84991931 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "name": "nightTab", "short_name": "nightTab", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", - "version": "6.1.0", + "version": "6.1.1", "manifest_version": 2, "chrome_url_overrides": { "newtab": "index.html"