klaro-js icon indicating copy to clipboard operation
klaro-js copied to clipboard

On accepting cookies focus is updated to klaro div causing view to jump/scroll to bottom of page

Open Caffe1neAdd1ct opened this issue 3 years ago • 0 comments

Commit issue introduced:

https://github.com/kiprotect/klaro/commit/42a7e682e9b9eff16874b69fff90b06df79affba#diff-0485cc594c4d2382f333b56f0f4d1212aa77732bc79667ad65124a70695e9e1a

Code sections causing the new bug:

if (this.noticeRef) {
        this.noticeRef.focus();
}

and

setTimeout(() => {
                if (this.noticeRef) {
                    this.noticeRef.focus();
                }
            }, 1);

both inside src/components/consent-notice.jsx

Removing these two blocks and rebuilding resolves the whole page jumping to the bottom on accepting or essential only cookie from Klaro.

Caffe1neAdd1ct avatar Dec 16 '21 13:12 Caffe1neAdd1ct