@socketsupply/components
Advanced tools
Comparing version 13.2.1 to 13.2.2
const Tonic = require('@socketsupply/tonic') | ||
const FOCUS_CHANGE_TIMEOUT = 100 | ||
let focused = true | ||
let focusedTimeout = null | ||
window.addEventListener('blur', () => { | ||
clearTimeout(focusedTimeout) | ||
focused = false | ||
}) | ||
window.addEventListener('focus', () => { | ||
clearTimeout(focusedTimeout) | ||
focusedTimeout = setTimeout(() => { focused = true }, FOCUS_CHANGE_TIMEOUT) | ||
}) | ||
class TonicDialog extends Tonic { | ||
@@ -175,3 +190,3 @@ constructor () { | ||
this._escapeHandler = e => { | ||
if (e.keyCode === 27) this.hide() | ||
if (focused && e.keyCode === 27) this.hide() | ||
} | ||
@@ -178,0 +193,0 @@ |
{ | ||
"name": "@socketsupply/components", | ||
"version": "13.2.1", | ||
"version": "13.2.2", | ||
"description": "Example components", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -390,4 +390,3 @@ const Tonic = require('@socketsupply/tonic') | ||
const rowsLength = this.rows ? this.rows.length : 0 | ||
const totalHeight = rowsLength * this.props.rowHeight | ||
const totalHeight = this.rows.length * this.props.rowHeight | ||
if ( | ||
@@ -404,3 +403,3 @@ viewEnd === totalHeight && | ||
if ( | ||
rowsLength === this.props.maxRowsLength && | ||
this.rows.length === this.props.maxRowsLength && | ||
viewStart === 0 && | ||
@@ -417,3 +416,3 @@ this.prefetchTop && | ||
if (!popHappened && ( | ||
rowsLength === this.props.maxRowsLength && | ||
this.rows.length === this.props.maxRowsLength && | ||
start <= this.props.prefetchThreshold | ||
@@ -465,6 +464,4 @@ )) { | ||
const start = i * parseInt(this.props.rowsPerPage, 10) | ||
const limit = Math.min((i + 1) * this.props.rowsPerPage, this.rows.length) | ||
const rowsLength = this.rows ? this.rows.length : 0 | ||
const limit = Math.min((i + 1) * this.props.rowsPerPage, rowsLength) | ||
const inner = this.querySelector('.tonic--windowed--inner') | ||
@@ -471,0 +468,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1011262
80
27344
0