From 94e26e59afe7233f5f01c83b4573ad14efa51a72 Mon Sep 17 00:00:00 2001 From: Matthew Mascord <27346863+matthewmascord@users.noreply.github.com> Date: Tue, 4 May 2021 12:00:51 +0100 Subject: [PATCH] PLATUI-1154: Add polyfill for Number.isNaN to fix timeout dialog issue on IE Tested that the timeout dialog displays on: Mac OS 11.3 Chrome 90 Mac OS 11.3 Firefox 88 Mac OS 11.3 Safari 14.1 Windows 10 IE 11 Windows 10 Edge 90 Windows 10 Firefox 88 Windows 10 Chrome 90 Android v9 Samsung Galaxy S10 Chrome Android v9 Samsung Galaxy S10 Samsung Internet iPhone X, iOS 14.4.2, Safari iPhone X, iOS 14.4.2, Chrome --- CHANGELOG.md | 6 ++++++ check-compatibility.js | 2 +- package-lock.json | 2 +- package.json | 2 +- src/components/timeout-dialog/validate-input.js | 2 ++ src/vendor/polyfills/Number/prototype/isNaN.js | 4 ++++ 6 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 src/vendor/polyfills/Number/prototype/isNaN.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 994e65bf..712f8e48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [1.33.0] - 2021-05-04 + +## Fixed + +- Fix timeout dialog on IE by adding polyfill for Number.isNaN + ## [1.32.0] - 2021-04-29 ## Fixed diff --git a/check-compatibility.js b/check-compatibility.js index 655a5975..7c17e987 100644 --- a/check-compatibility.js +++ b/check-compatibility.js @@ -14,7 +14,7 @@ if (!knownPrototypeKitNames.includes(consumerPackageJson.name)) { } const compatibility = { - 1.30: { + 1.33: { 'prototype-kit': ['9.12', '9.11', '9.10', '9.9', '9.8', '9.7', '9.6', '9.5', '9.4', '9.3', '9.2', '9.1', '9.0', '9.9', '9.10', '9.11'], }, 0.6: { diff --git a/package-lock.json b/package-lock.json index 5e708342..eb247e8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hmrc-frontend", - "version": "1.31.0", + "version": "1.33.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b3921eed..ecb548d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hmrc-frontend", - "version": "1.32.0", + "version": "1.33.0", "description": "Design patterns for HMRC frontends", "scripts": { "start": "gulp dev", diff --git a/src/components/timeout-dialog/validate-input.js b/src/components/timeout-dialog/validate-input.js index db8c2320..2c3c898a 100644 --- a/src/components/timeout-dialog/validate-input.js +++ b/src/components/timeout-dialog/validate-input.js @@ -1,3 +1,5 @@ +import '../../vendor/polyfills/Number/prototype/isNaN'; + function ValidateInput() { } diff --git a/src/vendor/polyfills/Number/prototype/isNaN.js b/src/vendor/polyfills/Number/prototype/isNaN.js new file mode 100644 index 00000000..aaa1a017 --- /dev/null +++ b/src/vendor/polyfills/Number/prototype/isNaN.js @@ -0,0 +1,4 @@ +// Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN +Number.isNaN = Number.isNaN || function isNaN(input) { + return typeof input === 'number' && input !== input; +}