diff --git a/.eslintrc.js b/.eslintrc.js index 067891b8..efd0d7fc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,6 +33,7 @@ module.exports = { files: ['*.js', '*.ts', '*.tsx', '*.d.ts'], rules: { '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', }, }, ], diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6d08e3..d90037cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Nothing yet! +## [1.1.3] - 2021-03-16 + +### Fixed + +- Fix height of the collapse div in case it changes + ## [1.1.2] - 2021-03-10 ### Fixed diff --git a/src/components/customization/collapse.tsx b/src/components/customization/collapse.tsx index 3983bb79..ceb13f5c 100644 --- a/src/components/customization/collapse.tsx +++ b/src/components/customization/collapse.tsx @@ -16,7 +16,7 @@ const Collapse: FunctionalComponent = ({ isOpen, children, onWindowResize const expand = useCallback((isResize = false) => { const { collapsedHeight, containerOffset } = getContainerHeights(); const windowHeight = window.innerHeight; - const collapseHeight = collapsibleDiv.current.scrollHeight; + const collapseHeight = collapsibleDiv.current.querySelector('.ct-policies')!.scrollHeight; if (isResize) { collapsibleDiv.current.style.transition = 'height 0ms ease-out'; diff --git a/src/components/customization/options.tsx b/src/components/customization/options.tsx index 045a787f..eb9ea38c 100644 --- a/src/components/customization/options.tsx +++ b/src/components/customization/options.tsx @@ -29,7 +29,7 @@ const Options: FunctionalComponent = ({ )); return ( -
+
{cookies} {cookiePolicy && (
diff --git a/src/tests/app.test.tsx b/src/tests/app.test.tsx index e4e8b821..3f1ad51b 100644 --- a/src/tests/app.test.tsx +++ b/src/tests/app.test.tsx @@ -119,6 +119,7 @@ describe('Cookie Though', () => { describe('if the user has a different browser font setting', () => { const renderApp = (fontSize: string) => { + container.style.fontSize = fontSize; return mount( { const wrapper = mount(
-

+
, @@ -49,7 +49,7 @@ describe('collapse', () => { const wrapper = mount(
-

+
, @@ -67,7 +67,7 @@ describe('collapse', () => { const wrapper = mount(
-

+
, ); @@ -87,7 +87,7 @@ describe('collapse', () => { const wrapper = mount(
-

+
, );