From b1369f76072bdb4dc072b1a6449822b8b1023f82 Mon Sep 17 00:00:00 2001 From: GeoSot Date: Tue, 16 Mar 2021 23:25:30 +0200 Subject: [PATCH 1/3] initial --- js/src/util/index.js | 2 +- js/tests/unit/util/index.spec.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/src/util/index.js b/js/src/util/index.js index e268b07287a0..e9950c9e387a 100644 --- a/js/src/util/index.js +++ b/js/src/util/index.js @@ -166,7 +166,7 @@ const isDisabled = element => { return element.disabled } - return element.getAttribute('disabled') !== 'false' + return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false' } const findShadowRoot = element => { diff --git a/js/tests/unit/util/index.spec.js b/js/tests/unit/util/index.spec.js index 24921d730e7b..6fa6e513f2f1 100644 --- a/js/tests/unit/util/index.spec.js +++ b/js/tests/unit/util/index.spec.js @@ -347,16 +347,19 @@ describe('Util', () => { expect(Util.isDisabled(div2)).toEqual(true) }) - it('should return false if the element has disabled attribute with "false" value', () => { + it('should return false if the element has disabled attribute with "false" value, or doesn\'t has attribute', () => { fixtureEl.innerHTML = [ '
', '
', + '
', '
' ].join('') const div = fixtureEl.querySelector('#element') + const div1 = fixtureEl.querySelector('#element1') expect(Util.isDisabled(div)).toEqual(false) + expect(Util.isDisabled(div1)).toEqual(false) }) it('should return false if the element is not disabled ', () => { From a96bdfb8547f969aba8cf21ff1350df03c9bdcd4 Mon Sep 17 00:00:00 2001 From: GeoSot Date: Tue, 16 Mar 2021 23:28:15 +0200 Subject: [PATCH 2/3] fix bundlewatch.config.js, fix typo --- .bundlewatch.config.json | 2 +- js/tests/unit/util/index.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bundlewatch.config.json b/.bundlewatch.config.json index 4a28264b3a99..b0e54e6c96db 100644 --- a/.bundlewatch.config.json +++ b/.bundlewatch.config.json @@ -54,7 +54,7 @@ }, { "path": "./dist/js/bootstrap.min.js", - "maxSize": "16.25 kB" + "maxSize": "16.26 kB" } ], "ci": { diff --git a/js/tests/unit/util/index.spec.js b/js/tests/unit/util/index.spec.js index 6fa6e513f2f1..41c1ce2b80b4 100644 --- a/js/tests/unit/util/index.spec.js +++ b/js/tests/unit/util/index.spec.js @@ -347,7 +347,7 @@ describe('Util', () => { expect(Util.isDisabled(div2)).toEqual(true) }) - it('should return false if the element has disabled attribute with "false" value, or doesn\'t has attribute', () => { + it('should return false if the element has disabled attribute with "false" value, or doesn\'t have attribute', () => { fixtureEl.innerHTML = [ '
', '
', From cb77669c2e0585396b6473dcb454769bc008e0df Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 17 Mar 2021 07:37:35 +0200 Subject: [PATCH 3/3] Create .bundlewatch.config.json --- .bundlewatch.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bundlewatch.config.json b/.bundlewatch.config.json index b0e54e6c96db..27b998c6201a 100644 --- a/.bundlewatch.config.json +++ b/.bundlewatch.config.json @@ -54,7 +54,7 @@ }, { "path": "./dist/js/bootstrap.min.js", - "maxSize": "16.26 kB" + "maxSize": "16.5 kB" } ], "ci": {